Thursday, June 13, 2013

schedule job using crontab

Most of you may already know it.

In terminal, type "crontab -e" you will enter edit mode to edit the crontab file, which has format as below:

0 0 * * * rm ~/scratch/.*.bam
0 0 * * 2,5 find ~/scratch/mouse* -exec touch {} \;

It's like Vim. After finishing the editing, type ":wq" to save/quit.

The 5th column is to set day of the action, e.g. 2,5 means every Tuesday and Friday. Get more detail by 'man crontab'.

No comments:

Post a Comment