Documentation/Unix/crontab

From systems
Jump to: navigation, search

crontab allows small recurring tasks to be run on the login nodes. Please note, crontab jobs run in a limited environment as it is intended for small, lightweight work loads.1

You may view your crontab schedule with the command 2:

$ crontab -l

To edit the schedule, type:

$ crontab -e

Crontab entry by example:

# these are sample tasks
@hourly    ~/bin/my-script
@weekly    ~/bin/my-other-script
@monthly   ~/bin/do-this-once-a-month

A more peculiar syntax in 5 fields is available if you require finer precision. Please type on a login node:

$ man 5 crontab

for more details.


Notes:

  1. Although it is possible to run virtually any program with crontab, for simple tasks you'll find it speedy enough - for anything complicated or hard, running it will be dreadfully slow and you should seriously consider having crontab submit a job to the cluster for heavy lifting.
  2. If you do not use ssh keys, you will be asked to authenticate with your ARCS password.
  3. One centralized crontab schedule is used for all the login nodes, so regardless of which login node in the pool you are using, you will always see the same schedule. Crontab tasks are run on a dedicated node. This node can do everything you can do on a login node (i.e. all your files, /ifs and running cluster jobs are all available).