Q

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.
This was first published in September 2005

Dig deeper on Oracle database backup and recovery

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close