Bash: schedule a command that will be run at reboot using cron
If there is a command that needs to run on startup/reboot, you can use the @reboot directive in cron to schedule it. Here is a simple example of logging the date to a file at startup. (crontab -l 2>/dev/null; echo “@reboot date >> ~/startup.log”) | sort -u | crontab – The sort command avoids duplicate … Bash: schedule a command that will be run at reboot using cron