- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: crontab removed by mistake (crontab -r instead...
Operating System - HP-UX
1752796
Members
5824
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО10-17-2005 04:46 AM
тАО10-17-2005 04:46 AM
crontab removed by mistake (crontab -r instead of crontab -e):
Since the letters "e" and "r" are next to each other, I mistyped "r" instead of "e" and it removed my crontab file. Is there anyway I can restore the removed the crontab file, please!?!?
Thanks!
Ravi.
Since the letters "e" and "r" are next to each other, I mistyped "r" instead of "e" and it removed my crontab file. Is there anyway I can restore the removed the crontab file, please!?!?
Thanks!
Ravi.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2005 04:50 AM
тАО10-17-2005 04:50 AM
Re: crontab removed by mistake (crontab -r instead of crontab -e)
You're in trouble. Get it from backup tape or from another system.
I always use a sequence like this:
crontab -l > cron.old
cp cron.old cron.new
vi cron.new
crontab < cron.new
Never, never, change anything without making a backup copy first.
I always use a sequence like this:
crontab -l > cron.old
cp cron.old cron.new
vi cron.new
crontab < cron.new
Never, never, change anything without making a backup copy first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2005 04:51 AM
тАО10-17-2005 04:51 AM
Solution
Restore from tape the following file:
/var/spool/cron/crontabs/[username].
So, if it's root's crontab that your after, restore /var/spool/cron/crontabs/root from your last backup.
/var/spool/cron/crontabs/[username].
So, if it's root's crontab that your after, restore /var/spool/cron/crontabs/root from your last backup.
We are the people our parents warned us about --Jimmy Buffett
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2005 01:07 PM
тАО10-17-2005 01:07 PM
Re: crontab removed by mistake (crontab -r instead of crontab -e)
Unfortunately, r and e are right next to each other. That's one of the reasons I never recommend -e. Instead, you start by creating a local copy of your crontab entry as in:
crontab -l > $HOME/crontab.root
Then, you edit the file, and once changes are complete, use:
crontab $HOME/crontab.root
to activate the new crontab list.
Bill Hassell, sysadmin
crontab -l > $HOME/crontab.root
Then, you edit the file, and once changes are complete, use:
crontab $HOME/crontab.root
to activate the new crontab list.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP