Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recover Crontab

1,605 views
Skip to first unread message

Cyril G

unread,
Jun 5, 2002, 6:57:07 PM6/5/02
to
Is there a way to recover a crontab entries? In solaris. I accidentaly
pressed return after I typed just crontab and then pressed control-D
to quit. it Emptied the file.

Cyril

Rev. Don Kool

unread,
Jun 5, 2002, 7:38:11 PM6/5/02
to
Cyril G wrote:


Apparently you didn't read the "crontab" man page very well.

NOTES
If you inadvertently enter the crontab command with no
argument(s), do not attempt to get out with Control-d. This
removes all entries in your crontab file. Instead, exit with
Control-c.

It's easily fixed however. Restore the file
"/var/spool/cron/crontabs/root" from your backups. Then send a HUP to
"cron" or do a "crontab /var/spool/cron/crontabs/root".

Hope this helps,
Don


--
*********************** You a bounty hunter?
* Rev. Don McDonald * Man's gotta earn a living.
* Baltimore, MD * Dying ain't much of a living, boy.
*********************** "Outlaw Josey Wales"

Chris Thompson

unread,
Jun 6, 2002, 11:54:47 AM6/6/02
to
In article <34d6209a.0206...@posting.google.com>,

Recover /var/spool/cron/crontabs/[USER] from a backup (not to the same
location: check/edit it first, and then run "crontab" on it to reinstate).

If you have anything non-trivial in a crontab, it is good practice to
keep the master copy elsewhere, using your favourite change-control
system, and put changes into effect by using "crontab [filename]"
on it, rather than fiddling around with "crontab -e". (That could be
part of a make rule, or an rdist "special", etc., in yet more elaborate
situations.)

Chris Thompson
Email: cet1 [at] cam.ac.uk

0 new messages