On an Amazon S3 Linux instance, I have two scripts called start_my_app
and stop_my_app
which start and stop forever (which in turn runs my
Many answers on starting something at boot, but often you want to start it just a little later, because your script depends on e.g. networking. Use at
to just add this delay, e.g.:
at now + 1 min -f /path/yourscript
You may add this in /etc/rc.local, but also in cron
like:
# crontab -e
@reboot at now + 1 min -f /path/yourscript
Isn't it fun to combine cron and at? Info is in the man page man at
.
As for the comments that @reboot may not be widely supported, just try it. I found out that /etc/rc.local has become obsolete on distros that support systemd, such as ubuntu and raspbian.