[rescue] Speaking of backups, scripting division

Sheldon T. Hall shel at cmhcsys.com
Sun Nov 10 15:52:55 CST 2002


"Greg A. Woods" <woods at weird.com> said

> [ On Sunday, November 10, 2002 at 14:20:49 (-0500), Sheldon T. Hall
wrote: ]
> > Subject: [rescue] Speaking of backups, scripting division
> >
> > Is there an easy way to turn a crontab entry into something a little
easier
> > on the eyes?  Specifically, I want to turn the minute-hour-day part of a
> > crontab line into a date.
> >
> > For example, I have a line in root's crontab that reads
> >
> > 59 02 * * 3 /usr/local/bin/backup_automatic
>
> Why not just add a comment header on the table!?!?!?
>
> # (note that on BSD there's an additional "user" field in the system
> # crontab file)
> #
> #minute hour mday month wday user command
> #
> */10 * * * * root /usr/libexec/atrun

I was rather unclear in my previous reply.  I want to turn the first 5
fields into a human-readable, unique date so I can put the resulting line of
text on a status report, or put it in the body of an e-mail.

Although comments in the crontab are good, and I have plenty of them, they
don't give me the ability to determine dynamically the date and time of the
next activity of interest.

I want to be able to do this ...

echo "The next $activity is scheduled for `crontab -l | grep $activity |
some_process`"

and get something anyone can read and understand, something I can include on
the system's status report, or put in the body of an e-mail, or use in other
ways that really have nothing to do with crontab.

What I lack is the program some_process, and I'm hoping someone here can
point me to the standard way of doing that.

Thanks, though.

-Shel



More information about the rescue mailing list