I need a simple way to run some script on reboot:
I read that @reboot in crontab can work, but looks like some linux does not accept it:
- Does it work on debian 7 ?
- Does it work on debian 8 ?
- Does it work on debian 9 ?
I need a simple way to run some script on reboot:
I read that @reboot in crontab can work, but looks like some linux does not accept it:
According to the man page of crontab
(Section 5):
Instead of the first five fields, one of eight special strings may appear:
string meaning ------ ------- @reboot Run once, at startup. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". @weekly Run once a week, "0 0 * * 0". @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *".
Please note that startup, as far as @reboot is concerned, is the time when the cron(8) daemon startup. In particular, it may be before some system daemons, or other facilities, were startup. This is due to the boot order sequence of the machine.
Run man 5 crontab
on Debian Wheezy to see the full page. (Or see it online)
It was never removed so it works on each later version, too.