Ubuntu 20.04 Execute command at system boot using crontab
From Notes_Wiki
Revision as of 03:38, 23 February 2023 by Saurabh (talk | contribs) (Created page with "Home > Ubuntu > Server or Desktop administration > Ubuntu 20.04 Execute command at system boot using crontab In case of Ubuntu 20.04 if we need to execute any command after system boot (the way used to happen via /etc/rc.d/rc.local long back), we can do the same via cron using: # Type below to open cron editing for current user (eg root) #:<pre> #:: crontab -e #:</pre> # In the cron file enter command to...")
Home > Ubuntu > Server or Desktop administration > Ubuntu 20.04 Execute command at system boot using crontab
In case of Ubuntu 20.04 if we need to execute any command after system boot (the way used to happen via /etc/rc.d/rc.local long back), we can do the same via cron using:
- Type below to open cron editing for current user (eg root)
- crontab -e
- In the cron file enter command to be executed on boot *with full path* as:
- @reboot <full-path-of-command>
- Optionally test by rebooting and validate.
Refer:
Home > Ubuntu > Server or Desktop administration > Ubuntu 20.04 Execute command at system boot using crontab