Mike Mavner
Mike Mavner

Reputation: 1

Daily reboot happens twice (cron)

I have created a cron job, which will reboot the system every day at 00:01 (AM), but as soon as the system comes back up and the cron daemon is back up (within the same minute) - another reboot occurs (which makes sense).

How can this be prevented without using a bash script that will sleep 24 hours? I am using Ubuntu Server 16.04 LTS 64bit.

Upvotes: 0

Views: 98

Answers (2)

user7744592
user7744592

Reputation:

Taken from this answer, you can just delay the reboot itself, which will solve your problem.

0 4   *   *   *    /sbin/shutdown -r +5

Upvotes: 3

Cyrus
Cyrus

Reputation: 88829

Your system may reboot too fast.

sleep 60; reboot

Upvotes: 1

Related Questions