- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cron problem
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
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
01-23-2002 12:02 PM
01-23-2002 12:02 PM
cron problem
First I did a crontab -l to list the crons. I did not see anything obvious.
Then I made the mistake of just running 'crontab' by itself. It came back with a blank line. I hit
I closed the terminal emulator session [IBM's Dynamic Connect] by simply closing the Windows window via
Now when I try a crontab -l, I get a message indicating "crontab: crontab can't open your crontab file".
Help would be appreciated.
Regards,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 12:13 PM
01-23-2002 12:13 PM
Re: cron problem
Oops, you created an empty crontab file!
I assume you have a backup, so, restore '/var/spool/cron/crontabs/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 12:16 PM
01-23-2002 12:16 PM
Re: cron problem
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 12:19 PM
01-23-2002 12:19 PM
Re: cron problem
just wondering what created the empty cron file? Hitting
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 12:53 PM
01-23-2002 12:53 PM
Re: cron problem
So basically, what James said above is exactly what happened. You ran the crontab command without a file and in effect overwrote your existing file and cron'd it with a blank file.
You can restore from a backup tape...and what I do as a real quick fix is make a backup (root.bak) of the file in /var/spool/crontabs
Because I always do things like this when I'm doing a quick fix and heading out the door. So I want to restore fast....
Just a thought,
Rit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 12:55 PM
01-23-2002 12:55 PM
Re: cron problem
Richard, I can reproduce Bill's problem. Actually the crontab file isn't emptied but removed.
Note what the man pages for 'crontab' say:
/begin_quote/
crontab [file] Create or replace your crontab file by copying the specified file, or standard input if file is omitted or - is specified as file, into the crontab directory, /var/spool/cron/crontabs.
/end_quote/
# crontab -l
...will echo nothing if a truly empty file exists. whereas a missing file returns:
"crontab: can't open your crontab file."
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 02:10 PM
01-23-2002 02:10 PM
Re: cron problem
First I made a root.bk and a root.bk1
then i cleared everything oout of root.bk1.
I ran the command
crontab root.bk1
checked crontab and guess what? It was empty,
crontab -l
returns nothing
crontab -e lets me edit the file.
Delete root ..
crontab -l
crontab: can't open your crontab file.
why .. because there is no file to open!
crontab root.bk
restores theback up file like rita mentioned.
The only thing I couldnt do was remove the crontab file by just doing
#crontab
other wise ..I did learn a little about crontab .. =)
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 04:13 PM
01-23-2002 04:13 PM
Re: cron problem
Now, if a mistake is made, the crontab entries are restored by simply running crontab file_name again.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2002 04:44 PM
01-23-2002 04:44 PM
Re: cron problem
occur was with a Junior, who was already told
never ever use 'crontab -e'
I *ALWAYS* use the habit of
# crontab -l > /tmp/wrk
# vi /tmp/wrk
make my changes
# crontab /tmp/wrk (to submit)
Guess what the Junior was instructed to
find the backup tape(s) after looking as
red as a tomato!
-Michael