Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Crontab Basics

Crontab is a scheduling system for linux. It allows you to schedule scripts and commands. Existing crontab entries are stored in per user files, but are not meant to be edited directly. These files are located as simple text files in the /var/spool/ folder:

$ cat /var/spool/cron/crontabs/<user>

Edit Crontab for User

To edit your user simply type:

crontab -e

Edit Crontab for Root

If you want to edit for root

sudo crontab -e

Edit Crontab for Any User

If you want to edit another user

sudo crontab -u <user> -e

List Jobs in Crontab

Like crontab -e, you can list jobs for yourself, root or other users:

  • crontab -l

  • sudo crontab -l

  • sudo crontab -l -u anyuser

Last updated on 17 Jul 2018
Published on 17 Jul 2018