- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: scheduling the cron jobs with the use of opera...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 10:52 PM
тАО06-27-2011 10:52 PM
Need to schedule the cronjob, like i am having 2 scipts on my crontab. if 1st job completed successfully then the 2nd job need to start. Is there any operands can we use for that. Please let me know if any options are there.
Thanks!
Simhan
Solved! Go to Solution.
- Tags:
- crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:24 PM
тАО06-27-2011 11:24 PM
Re: scheduling the cron jobs with the use of operands
You only have the first script in your crontab. If successful, the first script can start the next.
Or have three scripts. The new one starts the first and if successful, starts the next.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:26 PM
тАО06-27-2011 11:26 PM
Re: scheduling the cron jobs with the use of operands
Hi,
create a script f.e. cronscript.sh
/path/to/first/script && /path/to/second/script
add the following line to your crontab (Change times)
* * * * * /path/to/cronscript.sh
Or you can enter that line directly into the crontab, using && will only execute the second command if the return code of the first one was zero.
hth
Stephan
How to find the right forum --> New forum location by ITRC tree
"we wouldn't call it code, if we could read it ..."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:37 PM
тАО06-27-2011 11:37 PM
Re: scheduling the cron jobs with the use of operands
Hello Stephen,
If i want to scedule the ignite backup once the tape drive is rewinded
0 5 11 6 /usr/sbin/mt -t /dev/rmt/omn rewind && * * * * /usr/sbin/make_tape_recovery -A -i -v inc_entire=/dev/vg00 /dv/rmt/0mn
Is that right.. Please correct me if i am wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:46 PM
тАО06-27-2011 11:46 PM
Re: scheduling the cron jobs with the use of operands
>If I want to schedule the ignite backup once the tape drive is rewound
In this case you shouldn't have separate commands in crontab. Instead create one script that does the rewind, waits, then does the ignite.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:47 PM
тАО06-27-2011 11:47 PM
Re: scheduling the cron jobs with the use of operands
@simma100 wrote:Hello Stephen,
If I want to schedule the ignite backup once the tape drive is rewinded
0 5 11 6 /usr/sbin/mt -t /dev/rmt/omn rewind && * * * * /usr/sbin/make_tape_recovery -A -I -v inc_entire=/dev/vg00 /dv/rmt/0mn
Is that right.. Please correct me if I am wrong.
Hi again,
0 5 11 6 /usr/sbin/mt -t /dev/rmt/omn rewind && /usr/sbin/make_tape_recovery -A -I -v
This should work, or as mentioned before create separate scripts for it.
Best,
Stephan
How to find the right forum --> New forum location by ITRC tree
"we wouldn't call it code, if we could read it ..."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:56 PM
тАО06-27-2011 11:56 PM
Re: scheduling the cron jobs with the use of operands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:57 PM
тАО06-27-2011 11:57 PM
SolutionUps,
sorry of course you should add it - seems i did not copy all, to finalize
0 5 11 6 /usr/sbin/mt -t /dev/rmt/omn rewind && /usr/sbin/make_tape_recovery -A -I -v inc_entire=/dev/vg00 /dv/rmt/0mn
Best,
Stephan
How to find the right forum --> New forum location by ITRC tree
"we wouldn't call it code, if we could read it ..."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2011 11:59 PM
тАО06-27-2011 11:59 PM
Re: scheduling the cron jobs with the use of operands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2011 05:03 AM - edited тАО06-28-2011 05:05 AM
тАО06-28-2011 05:03 AM - edited тАО06-28-2011 05:05 AM
Re: scheduling the cron jobs with the use of operands
Actually, there are a lot of problems with just a rewind and trying to run the backup with a one-liner. Here are the things that need to be checked before you start the Ignite backup:
- Is the device file really a tape?
- Is there a tape inserted in the drive?
- Is the tape write-protected?
- Is the tape busy with another program?
Now the make_tape_recovery program can be run. Additionally, the steps above and the MTR command should be logged in case of a problem and ideally, an email sent to the system administrators. I have attached a script that accomplishes all of these tests and writes the results into the file /var/adm/mtr.log. You can store the file in /usr/contrib/bin/mtr and schedule it in cron like this:
1 1 * * 0 /usr/contrib/bin/mtr /dev/rmt/0mn admins@mycompany.com
That above will run the backup every Sunday at 1:01am.
Bill Hassell, sysadmin