I am trying to run a RAKE file from a bash script fired by a crontab:
my crontab looks like this:
* * * * * /bin/bash ~/sites/www/tweeet/get_tweeet.sh my bash script (get_tweeet.sh) looks like this:
1 #!/bin/bash 2 set -x 3 cd /var/www/tweeet/ 4 export RAILS_ENV=development 5 rake get_tweeet >> /var/www/tweeet/test.log 6 echo "$(date): cron job run " >> /var/www/tweeet/test.log What happens is that line 6 outputs into the test.log but line 5 does now - the rake does not run.
BUT if i call the script using the exact line from the crontab
/bin/bash /var/www/tweeet/get_tweeet.sh then it works - i'm baffled by this!
rakein thePATHof yourcrond(8)? If not, try adding the directory to your/etc/environmentfile if your system supports it (and your PAM is configured to use it) or directly to yourcrontab(5)file withPATH=/sbin:/usr/sbin:/bin:/usr/bin:/path/to/rake/home