1840935 Members
1598 Online
110174 Solutions
New Discussion

help with cron pls

 
SOLVED
Go to solution
sanjit chand_2
New Member

help with cron pls

Being very new in Unix, I need a little assistance in creating a cron job to do a make recovery. I need to execute the make_recovery -Ai command to run once a week that will create a boot tape for me. Any help will be greatly appreciated.
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: help with cron pls

I have a script that I wrote that runs the make_tape_recovery command for me.

Here is the cron entry:

00 19 * * 1 /sys_backups/make_sys_backup.new 2>&1 | mailx -s "uran make recovery" patrickwallek@upr.com

Here is the script make_sys_backup.new:

#!/bin/sh
#
# Written by - Patrick Wallek
# Date - 3/16/1999
# Purpose - Run an Ignite UX backup utilizing the make_recovery command
# and the run the rotate_tapes script to rotate the system backup tapes.
#
/usr/bin/mt -f /dev/rmt/0mn rew

date | mailx -s "make_recovery started on uran" patrickwallek@upr.com

/opt/ignite/bin/make_tape_recovery -a /dev/rmt/0mn -I -t "Make recovery of UPR system `uname -n` on `date`" -v -x inc_entire=vg00 2>&1 | mailx -s "make_recovery_on_uran" patrickwallek@upr.com

date | mailx -s "make_recovery finished on uran" patrickwallek@upr.com

/usr/bin/mt -f /dev/rmt/0mn offl
Victor_5
Trusted Contributor

Re: help with cron pls

Use crontab -e and see more in man crontab
Harinath N
Frequent Advisor

Re: help with cron pls

Hi,

Just run "crontab -e" command, which in turn will open your cron file in vi mode, in that add the following entry and save it.

0 0 * * 5 /recovery_script

The above one would run on all friday's at midnight.
The script /recovery_script is as follows:

#!/sbin/sh
#script for creating a recovery tape
#date

#

/opt/ignite/bin/make_recovery -v -A -i -C -d /dev/rmt/0m

# script ends here


The option -C will create the system status file under /var/opt/ignite/recovery/makerec.last.


Hope this one will help you.

Regards,
N.Harinath.
Jack Werner
Frequent Advisor

Re: help with cron pls

I know this may sound moot, but make sure you have mounted a scratch tape in the tape drive before the job runs. We use cron scheduled make system bootable backup tape on 5 Unix servers and must unload each and store it in our tape vault and stock each tape drive with the next tape in rotation. We use 3 cycles for rotation; A,B,C.
i'm retired