Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want a cronjob to run at 10:20 and 12:45. Is it possible to set it in one line using cron ?

I know I can add to two similar lines one for 10:20 and another for 12:45.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

No, you can't do this in one line with CRON.

share|improve this answer

The closest you could get with a one-liner is for it to run at

10:20, 10:45, 12:20, 12:45

20,45 10,12 * * * /my/script.sh

Otherwise, make the run run every 5 minutes and add the logic to your script to only execute at those given times.

*/5 * * * * /my/script.sh
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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