1

I am trying to make a cron job that stops at 12am today(friday) then start again Monday at 7am, what would the script for this look like, I am new to cron jobs.

3

1 Answer 1

0
* * * * * /bin/timeout -s 2 10 /path/to/your/script.sh

Above kills after 10 minutes.

"12am today (Friday) then start again on Monday at 7am" - This looks more like a SERVICE than a cron job. However it is possible to assign a PID to this long cron job and add another cron job to kill this PID of the first.

The * * * * * from left to right:
Minute (Numeric) | Hour (Numeric) | Day of Month (Numeric) | Month (Numeric) | Day of the Week (0=Sunday, 1=Monday..)

Month and Day in some crontabs also accepst strings like Dec, Mon etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .