0

What command should I add in cron, so that it reboot the server after seven days of up time at specific time.

I can use @daily root /sbin/shutdown -r now to do that daily at assigned time, but I was not able to figure out the modification for seven days.

1 Answer 1

0

You can use the dow, or Day of Week, part of the crontab syntax, to execute the command on every occurrence of a particular day, using numbers in the form:

0-6 Sunday to Saturday

1-7 Monday to Sunday

Or even shortened word notation such as WED or THU for Wednesday or Thursday

# m h  dom mon dow   command
00 07 * * 5 your-command-here

The example above would run the command at 7:00 am every Friday

You must log in to answer this question.

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