I know there's at least 4 other threads related to this here. I've read them over but I'm still stuck.
I have a simple shell script that pushes files from my server to Amazon S3 for backup, then writes the results to a file called 'scrap.'
The script runs perfectly when I run it manually as myself, but when I run it as a cron job - from either the system cron or my user cron, it runs fine and will create my scrap file but it doesn't write
Here's my script
ruby '/home/my_username/s3sync/s3sync.rb' -r -s -v --dryrun '/var/www/html/' my_S3_server:www > '/home/my_username/s3sync/scrap'
I've saved the script as an executable .sh file, and the file is owned by me (it was owned by root, but I chown-ed to me to see if that would work but it didn't).
Editing crontab from my home directory with crontab -e, my crontab looks like this:
# testing cron job of backup of vhosts to Amazon S3
20 9 29 9 3 '/full_path_to_my_script.sh'
I've tried everything I can think of, including:
- making my results file world writable
- adding my username to the crontab
- adding my username to a cron.allow file (cron.deny is empty)
Also, I tail -f the cron log when I run it so I know the job does run.
Is my crontab missing some environmental variables?
Thanks for any help. I'm very new at this.