Problem solve Get help with specific problems with your technologies, process and projects.

Scheduling backup jobs in Linux

How do I schedule my backup jobs in Linux? I scheduled a job using crontab, but it didn't run.

How do I schedule my backup jobs in Linux? I scheduled a job using crontab, e.g., 30 13 * * * /backup_script/backup_rman_full.sh. Nothing happened, it didn't run. My database platform is Oracle 9i and my operating system is Red Hat.
The trickiest thing with scheduling shell scripts in cron is that the shell script does not run with your current environment settings. If you simply execute the shell script at your command line prompt, your script can use all of your session's current environment variables.

When that same script is executed via cron, you do not get your session's environment variables. So your shell script needs to have the environment variables it needs coded in the script.

To run the shell script just like cron would run it, use the "sh -x" command. For instance, to run your backup script like cron would, do the following:

sh -x /backup_script/backup_rman_full.sh
If there is an error in your script, you will find it when it is run in this manner. Fix any and all errors and then cron should have no problems running this script.

Dig Deeper on Oracle database backup and recovery

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.