S3Sync.net

General Category => Questions => Topic started by: seengee on December 13, 2007, 07:39:07 AM



Title: sync from cron - ruby: command not found
Post by: seengee on December 13, 2007, 07:39:07 AM
Hi,

I have created a script for backing up to s3, this runs fine when invoked from the command line by myself just running ./sync_wednesday.sh but when i attempt to run this script from a cron like this:

01 06 * * 4 root run-parts /home/s3sync/syncscripts/sync_wednesday.sh

i get an email saying:
/home/s3sync/syncscripts/sync_wednesday.sh: line 6: ruby: command not found

sync_wednesday.sh looks like this:

#!/bin/bash
# script to upload local directory upto s3
cd /home/s3sync/s3sync/
export AWS_ACCESS_KEY_ID=55555555555555555555555
export AWS_SECRET_ACCESS_KEY=55555555555555555555555555555
export PATH=/usr/local/bin:$PATH
ruby s3sync.rb -r --ssl --delete /backup/cpbackup/daily/  myBackup:serverName/wednesday/


the export PATH bit is just guesswork on my part, ruby is in that directory so i figured that might help but it doesnt.

any ideas?



Title: Re: sync from cron - ruby: command not found
Post by: ferrix on December 13, 2007, 09:05:50 AM
Why not just make the command say /usr/local/bin/ruby then?