Quote:
Code:
0 3 * * * "cd /var/scripts; ./serverbackup.sh > /tmp/backup_logs" |
So:
1) Get the $PATH for the user you are running the script with and paste it under PATH in the crontab file 2) put /bin/sh in front of the command and don't forget the username either Troubleshooting steps: 1) output some command to a file every minute, for example * * * * * root env > /tmp/env_output 2) If no output, check if crond is running 3) If output, try running the command manually from the shell and correct any errors that occur |
If the script has executable perms and has the first line '#!/bin/bash' (normal setup), then no need for eg /bin/sh in cron entry.
Speaking of which, if you use that approach, select the exact shell you want eg either sh or bash; they're not the same thing. For portability I ALWAYS put the correct one in the first line of the script and use execute perms. Also, I'd put the PATH inside the script for the same reason. It makes cron less cluttered and not all scripts need the same PATH. |
All times are GMT -5. The time now is 02:57 AM. |