> I searched the OpenSolaris Bible and the internet but didn't find a
> suitable answer to how to configure cron jobs in OpenSolaris? Any hint?

Personally I don't like crontab -e because the editor variable needs to be
set.  Also there's no backup if you make a mistake.  Instead, I like to use
"crontab -l > .crontab" and then "vi .crontab" and then "crontab .crontab"

You should man crontab, but be aware of the following.

# This is a typical crontab on my systems.
#    field          allowed values
#    -----          --------------
#    minute         0-59
#    hour           0-23
#    day of month   1-31
#    month          1-12
#    day of week    0-6 (0 is Sun)
*  *  *  *  *  /usr/bin/date > /timestamp.txt

Beware that jobs run under crontab (or run under "at") don't necessarily
have the same environment as your login shell.  In fact, I think the default
is to run cron jobs with bash, and at jobs with sh, or vice-versa, assuming
your login shell is bash.  To simplify this problem, I often create crontabs
like this one:
# Run one minute after midnight, every day
01 00 * * * /usr/bin/bash -cl '/path/to/somescript >>
/path/to/outputlogfile.txt 2>&1'

This ensures a "normal" or at least "familiar" operating environment.

_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to