I asked a similar question :( Download the synchronization script ), but then changed it and realized that now another question.
I want to make a script called uploadtimer.sh that uploads files to different hosts and then marks the upload time to the log file. Thanks to those who helped me, I have a partial solution, but I'm stuck:
I used this as crontab (testing it for the first ten minutes after 11 a.m.)
1,2,3,4,5,6,7,8,9,10 11 * * * /usr/bin/time -a /usr/local/apache/sites/$MYEMPLOYER/upload_test/output.log /usr/local/apache/sites/$MYEMPLOYER/upload_test/uploadtimer.sh
upload_test / contains the following files:
upload_test / output.log upload_test / uploadtest.gif upload_test / uploadtimer.sh
output.log is a text file that I renamed to a .log file. This is empty. Before I posted it there, I received messages saying that "this file does not exist." I thought this would create for me, but I think not. After I created it, he continued to speak in crontab letters, which I could not write until I changed my permissions, so I did it.
uploadtest.gif is a gif
uploadtimer.sh:
#!/bin/sh
HOST='--myhost--'
USER='--login--'
PASSWD='--password--'
FILE='uploadtest.gif'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
The message cron sends me is:
0.00user 0.00system 0:00.02elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+253minor)pagefaults 0swaps
But there was no ftp and nothing was written to output.log.