Being a Linux system admin or even a general Linux user you might be required to run some commands or scripts at a regular interval or at a needed time. We use crontab to accomplish these tasks amp we have already discussed Crontab in our tutorial. But how can we execute a command or script on system startup or after a reboot.
Well there are two ways we can execute a command or script on system startup or after a reboot.
1- using etcrc.local file.
p alignleftRecommended Read Beginners guide to Backup Postgres Database.
Also Read Scheduling CRON Jobs with Crontab for Beginners.
Lets discuss both these methods one by one.
This is my go-to method when I need to execute a command or script on system startup. To execute a command on startup open the file etcrc.local.
Read Full Post
News Link: https://thelinuxgurus.com/how-to-execute-a-command-or-a-script-on-system-startup-or-reboot/.
RSS Link: https://thelinuxgurus.com/feed/.
Linux Chatter is a news aggregator service that curates some of the best Linux, Cloud, Technical Guides, Hardware and Security news. We display just enough content from the original post to spark your interest. If you like the topic, then click on the 'read full post' button to visit the author's website. Use Linux Chatter to find content from amazing authors!
Note: The content provided has been modified and is not displayed as intended by the author. Any trademarks, copyrights and rights remain with the source.
Disclaimer: Linux Chatter sources content from RSS feeds and personal content submissions. The views and opinions expressed in these articles are those of the authors and do not necessarily reflect those of Linux Chatter.