System Administration Guide, Volume 2

How to Remove a crontab File

  1. (Optional) Become superuser to remove a crontab file belonging to root or another user.

  2. Remove the crontab file.


    $ crontab -r [username]

    username

    Name of another user's account, and requires superuser privileges to create or edit. 


    Caution - Caution -

    If you accidentally enter the crontab command with no option, press the interrupt character for your editor. This allows you to quit without saving changes. Exiting the file and saving changes at this point would overwrite an existing crontab file with an empty file.


  3. Verify the crontab file is removed.


    # ls /var/spool/cron/crontabs
    

Example--Removing a crontab File

The following example shows how user smith uses the crontab -r command to remove his crontab file.


$ ls /var/spool/cron/crontabs
adm     jones     lp     root    smith    sys     uucp
$ crontab -r
$ ls /var/spool/cron/crontabs
adm     jones     lp     root    sys    uucp