Executing command on systemd poweroff/reboot
Hello LQers! Long time no visit. I reinstalled my Arch system and now experiencing the death of GNU/Linux as a normal and useful operating system. It went to barely usable garbage. I hate it now and I am severely disappointed in nearly all the development processes going on in the community. Anyway, with this new garbage-dee thing I can't figure out how to execute random command on reboot/poweroff (automatically, as root), just like I did it with echoing string to "/etc/rc.local.shutdown". Can anyone please just tell me? Because I tried to search and get suggestions like
Code:
[Unit] |
A cron job could fit the job of doing something at startup (ie. stage 2 of a reboot, turning on again)
To add these cron jobs to the system, go to the console and do the following: Code:
crontab -e Quoting from the Cron Wikipedia page: Quote:
Quote:
Code:
@reboot [what to do] Code:
@reboot sh /home/Alex/Desktop/script.sh As for the shutdown part of your question, you could just have a .sh file somewhere on your computer containing Code:
[stuff to do, ie. echo Goodbye!] Hope I helped. :) |
Yes, thanks, I didn't think of that solution.
|
All times are GMT -5. The time now is 09:22 PM. |