Ubuntu 20.04 Execute command at system boot using crontab

From Notes_Wiki

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:

  1. Type below to open cron editing for current user (eg root)
    crontab -e
  2. In the cron file enter command to be executed on boot *with full path* as:
    @reboot <full-path-of-command>
  3. Optionally test by rebooting and validate.

Refer:


Home > Ubuntu > Server or Desktop administration > Ubuntu 20.04 Execute command at system boot using crontab