Scheduling a command on boot it’s easy and it can be done with different ways. One, with cronjobs and second, with the rc.local file (/etc/rc.local). Third, by putting your own script in /etc/init.d/. Fow now I’ll take the easy way to do it, the one with the rc.local.
Requirements:
Implementation
Open terminal Ctrl + Alt + T, connect via ssh or just type
1 |
$ sudo nano /etc/rc.local |
Add the command you want. For example…you can notify yourself when your machine is On
1 |
$ echo "$HOSTNAME: I'm awake!" | mutt -s OnBoot-Notification test@whatever.com |
Or
When the machine is on shows you who rebooted the machine before.
1 |
$ last | grep 'reboot' | mutt -s Last-Reboot-Poweroff-Notification test@whatever.com |
Regards,
Specktator