You Asked: How Will You Execute a Linux Command After Every Reboot Using Cron?
Contents How Will You Execute Linux Command After Every Reboot Using Cron? to Run a Cron Job at Every System Boot, Add a String Called @Reboot to the End of...
Contents
How will you execute Linux command after every reboot using cron?
To run a cron job at every system boot, add a string called @reboot to the end of the task list. The job defined by this string runs at startup, immediately after Linux reboots. Note: Always use the full path to the job, script, or command you want to run, starting from the root.
How do I run a Linux script after reboot?
This is the way I do it on Red Hat Linux systems. Put your script in /etc/init. d , owned by root and executable.
…
Test Test Test:
- Run your test script without cron to make sure it actually works.
- Make sure you saved your command in cron, use sudo crontab -e.
- Reboot the server to confirm it all works sudo @reboot.