- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron jobs - help needed
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
Forums
Discussions
Discussions
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
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
04-30-2004 06:59 AM
04-30-2004 06:59 AM
cron jobs - help needed
I have scheduled a script using crontab. I used the command crontab cron.txt where the cron.txt file included the sceduling details.
But after doing this when I viewed the scheduled jobs using "crontab -e", I noticed that only the job which i scheduled recently is available and all the other scheduled jobs are missing.
Did I delete all the other scheduled jobs in my server. In that case is there any way to revert back all the other scheduled jobs.
Can anyone please help out in this problem. I will be in deep trouble if I have accidentally deleted all the scheduled jobs.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:06 AM
04-30-2004 07:06 AM
Re: cron jobs - help needed
crontab -l user > /tmp/text_file
vi /tmptext_file
do your changes and save.
and crontab /tmp/text_file
you have lost your contab. check if you had ever taken backup of your crontab. /var/adm/cron/crontabs
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:08 AM
04-30-2004 07:08 AM
Re: cron jobs - help needed
Looks like you will need to restore the /var/spool/cron/crontabs/root file from backup.
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:10 AM
04-30-2004 07:10 AM
Re: cron jobs - help needed
does the cron.txt include all the previous cron jobs.
As what user did you do the command.
could you please also give the exact command you executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:10 AM
04-30-2004 07:10 AM
Re: cron jobs - help needed
To bring up the active cronfile that you as the user have out there you could simply have typed:
crontab -e
And then edited the file and saved it, thus making it active for the scheduled jobs mentioned within.
Try going out to /var/spool/cron/crontabs and see if there is an old cron.txt file there. It is possible you may have this cron.txt file existing in multiple places and only one of them is going to be run...
Just a thought,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:12 AM
04-30-2004 07:12 AM
Re: cron jobs - help needed
#crontab -e user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 01:57 PM
04-30-2004 01:57 PM
Re: cron jobs - help needed
Good news, bad news -
Bad news, the only crontab that was affected (accidentally deleted) is the crontab for the user you were logged in as.
Good news, if another user on the system has the same requirements and may have the same crontab, you can make a copy of that user's crontab and submit that crontab for the user that was affected.
To safely edit the crontab file you can either perform a 'crontab -e' and edit the file and re-submit after making the changes or the safer method is to dump your crontab to a file, make the changes in the file, then submit the file back to cron ... and if you are worried about security, ensure the permissions are strong on the file you dumped and edited, or just remove it after you've submitted the update to cron AND verified the new crontab has been updated. Sample of this is 'crontab >crontab.bak'
The above method can be used to restore your affected users' crontab by making a backup of another users' crontab, ensure the permissions are loose enough that the affected user can view and make changes, then su to your affected user, view and make the changes and then submit them back to cron 'crontab
That should do it. Hope you have another user that has a similar crontab. If you don't, hope you have a good backup of the /var/spool/cron/crontabs files. Hope this helps. Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 02:00 PM
04-30-2004 02:00 PM
Re: cron jobs - help needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2004 10:22 AM
05-01-2004 10:22 AM
Re: cron jobs - help needed
crontab -l > mycrontab
vi mycrontab
once changes are made:
crontab mycrontab
this is apperently the safest and recomended way.
You can copy another user's cron but if there entries were not the same then the deleted file will not match your original cron - do you backup?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2004 02:48 PM
05-02-2004 02:48 PM
Re: cron jobs - help needed
Crontab some_file will replace the existing cron job with the jobs listed in the file given in the command line, in this case some_file.
It is difficult to get the previous list of cron jobs if you don't have a backup copy. Restore it from the backup id possible.
Hope this helps.
Regds