Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: August 2021

About the crontab File

The cron daemon schedules system tasks according to commands found within each crontab file. A crontab file consists of commands, one command per line, that is executed at regular intervals. The beginning of each line contains date and time information that tells the cron daemon when to execute the command.

For example, a crontab file named root is supplied during the Oracle Solaris software installation. The file's contents include the following command lines:

10 3 * * * /usr/sbin/logadm (1)
15 3 * * 0 /usr/lib/fs/nfs/nfsfind (2)
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 (3)
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean (4)

    The output for each of these command lines is as follows:

  • The first line runs the logadm command at 3:10 am every day.

  • The second line executes the nfsfind script every Sunday at 3:15 am.

  • The third line runs a script that checks for daylight savings time (and make corrections, if necessary) at 2:10 am daily.

    If there is no RTC time zone or /etc/rtc_config file, this entry does nothing.

    x86 only -  The /usr/sbin/rtc script can be run on an x86 based system only.
  • The fourth line locates and removes duplicate entries in the Generic Security Service table, /etc/gss/gsscred_db, at 3:30 a.m. daily.

For more information about crontab syntax, see Syntax of crontab File Entries.

The crontab files are stored in the /var/spool/cron/crontabs directory. Several crontab files besides root are provided during Oracle Solaris software installation.




General system functions and file system cleanup


Performance data collection


General uucp cleanup

Besides the default crontab files, you can create crontab files to schedule your own system tasks. Custom crontab files are named after the user accounts in which they are created, such as bblack, mjane, dsmith, or jdoe.

To access crontab files that belong to root or other users requires that you assume the root role.