how to schedule a script in linux
Hi
i have oracle installed on Linux i want to schedule a script "backup.sh" to run in oracle user. oracle@linux1]crontab -e */2 * * * * /tmp/backup.sh this script does not execute by cron. BUT oracle@linux1 tmp] ./backup.sh ------executes successfully I dont know why the script is not being executed by cron kindly help me |
Make sure crond service is running.
Code:
# service crond status |
If even cron is running, try this
bash /tmp/backup.sh in the cron file. |
Quote:
please, remember that cron commands are executed with a different environment: for example you do not have the PATH, so commands that are found from command line are not found from cron. Just a supposition! bye giammy |
To test, create a simple script which will create a file .
make sure to give the whole path to the commands and files. See if it works. Then you know the problem is the script, not cron |
show the script content; also if it has an error either the cron job owner or root should get an email from cron re any errors. Try
mailx from the cmd line as owner and as root to see. Also, check /var/log/messages. |
All times are GMT -5. The time now is 06:56 AM. |