-6

This question already has an answer here:

How can I run a job every 2 minutes through crontab in Linux?

marked as duplicate by Jeff Schaller, ilkkachu, Mr Shunz, Jaroslav Kucera, Shadur Mar 18 at 19:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

The crontab format is described in section 5 (file formats) of the manual. With most man implementations for Linux, you do:

man 5 crontab

to read it (on some systems, you need man -s 5 man instead). man crontab would give you the manual of the crontab command (in section 1 of the manual). See man man for more information.

While historically, you'd have needed:

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /path/to/script

(every 2 minutes starting at 00:00:00)

or

1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * /path/to/script

(every 2 minutes starting at 00:01:00)

With modern cron implementations (including the ones typically found on Linux distributions), you can simplify it to:

*/2 * * * *    /path/to/script
1-59/2 * * * * /path/to/script

If you want to run it every 2 minutes starting at 00:00:34, you can always write it:

*/2 * * * * sleep 34; /path/to/script

Not the answer you're looking for? Browse other questions tagged or ask your own question.