How to use @reboot for crontab with delay

6

5

In crontab, I can use @reboot to run a command after the system reboot. Is there a way to do this with an delay, i.e. run a command after 10 minutes of reboot?

ltfishie

Posted 2012-05-22T19:47:16.370

Reputation: 195

Answers

17

Use the following:

@reboot /bin/sleep 600 ; /path/to/your/your_program

This will suspend execution of the shell for 600 seconds, and then run /path/to/your/your_program. Depending on your SHELL used for cron commands, the command syntax might be different.

Daniel Beck

Posted 2012-05-22T19:47:16.370

Reputation: 98 421