Operating System - HP-UX
1836404 Members
2660 Online
110100 Solutions
New Discussion

Re: crontab-file has lost 9 from 10 entries

 
bAU
New Member

crontab-file has lost 9 from 10 entries

Hello, I has a problem with crontab (HPUX10.20 C200) crontab all
entries lost, except only one. Can it occur from alone, or someone
the file manipulated? Thanks bAU
7 REPLIES 7
Amruth
Regular Advisor

Re: crontab-file has lost 9 from 10 entries

Hi,

Just a thought ....

It cannot go by itself unless otherwise it is removed by a script or editing..........

Wish you a good day...

Ar
If i am doing the same way you are doing to me then what is the difference between us.
MAD_2
Super Advisor

Re: crontab-file has lost 9 from 10 entries

Try to look at your logs (any log that may be active) to find out if someone from outside got into your server between the time everything was OK and when you encountered the problem. As "Ar" mentioned, this could not happened on its own.

I normally keep a copy of cron as well as many other essential files/scripts saved up in a different system (FTP them to a secured system), just in case changes are made to it and things start working oppossite to what we desire or just in case of a major disaster.

Check if you have any recent copies in "/var/spool/cron/crontabs", find out if anyone made a copy and left it somewhere in the system.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Bill Hassell
Honored Contributor

Re: crontab-file has lost 9 from 10 entries

crontab is particularly vulnerable to accidental changes. CFor root's crontab, just a single command will replace or wipe out all crontab entries.

As Mynor said, keeping a reference copy of crontab (and other important files) is very important. You can restore your lost crontab entries from your backup tape. All active crontab entries are stored in /var/spool/cron/crontabs.

After restoring your file(s), make a reference copy:

# crontab -l > /root/crontab.root

From now on, never use crontab -e for editing. Instead, edit your reference copy, then replace the current crontab by:

# crontab /root/crontab.root


Bill Hassell, sysadmin
harry d brown jr
Honored Contributor

Re: crontab-file has lost 9 from 10 entries

bAU,

Definitely user error.

live free or die
harry
Live Free or Die
Kenny Chau
Trusted Contributor

Re: crontab-file has lost 9 from 10 entries

Well, I had experienced that once before. Just after system crash and the crontab file back to the original state, all the entries had been lost. I had to restore the crontab file from tape to solve this problem.

Hope this helps.
Kenny.
Kenny
bAU
New Member

Re: crontab-file has lost 9 from 10 entries

Thank you for the assistance.
Obviously has crontab through crontab -l everything its entries lost.
A line still remained, was those,
which was entered independently later by the Omniback
bAU
Steven Sim Kok Leong
Honored Contributor

Re: crontab-file has lost 9 from 10 entries

Hi,

If your filesystem was full when you executed crontab -e, you have a high chance of zero'ing your crontab.

Was your filesystem full lately ie. check your /var/adm/syslog/syslog.log for any filesystem full error messages lately?

Hope this helps. Regards.

Steven Sim Kok Leong