I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is:
55 23 * * * /usr/bin/archive_logs
The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously stopped working. I removed the entry from cron, re-added it. I even changed the time in the cron entry and tried it again. It still won't run from cron, but, again, works like a champ when I run it manually.
Below is the script:
#!/bin/sh
DAY=`date +%m%d%y`
#Copy log to /tmp and add timestamp
cp /archive/logs/sys/alarm.log /tmp/alarm.log.$DAY
#Send file to webservers
cd /tmp
ftp -n 123.45.678.90 << !
user xxxxxxxx yyyyyyyy!
cd Developers/VMSMSP/Archive/MSP/MSPWASH
put alarm.log.$DAY
!
#Cleanup
cd /tmp
rm alarm.log.$DAY
Any ideas?