System Administration Guide: Advanced Administration

Example—Creating or Editing a crontab File

The following example shows how to create a crontab file for another user.


# crontab -e jones

The following command entry added to a new crontab file automatically removes any log files from the user's home directory at 1:00 a.m. every Sunday morning. Because the command entry does not redirect output, redirect characters are added to the command line after *.log to make sure that the command executes properly.


# This command helps clean up user accounts.
1 0 * * 0 rm /home/jones/*.log > /dev/null 2>&1