I asked a similar question over here:(http://stackoverflow.com/questions/1495604/upload-clocking-script), but then changed it and realized it's a different question now.
I want to make a script called uploadtimer.sh which uploads files to various hosts and then notes the time the upload takes in a log file. Thanks to those who have helped me, I have a partial solution but I'm stuck:
I used this as a crontab (testing it for the first ten minutes after 11 am)
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/ has these files in it:
upload_test/output.log upload_test/uploadtest.gif upload_test/uploadtimer.sh
output.log is a text file that I renamed as a .log file. It's blank. Before I put it there, I was getting messages that said "this file doesn't exist". I thought it'd create one for me but I guess not. After I created it, it kept saying in the crontab mails that I couldn't write to it until I changed its permissions, so I did.
uploadtest.gif is a gif
uploadtimer.sh is this:
#!/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 that cron sends to me is:
0.00user 0.00system 0:00.02elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+253minor)pagefaults 0swaps
But no ftp has taken place and nothing it written in output.log.