I have an ubuntu computer, which is running on a dell990 pc:
uname -a
Linux dell 4.15.0-188-generic #199-Ubuntu SMP Wed Jun 15 20:42:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
i want the computer to turn on via a bios power-on, run a backup script then turn off - so the computer only uses power while i need it to.
i am using a cron @reboot script, and i want the computer to shutdown afterwards. i have this a sudo crontab.
sudo crontab -l
[sudo] password for pgee:
@reboot /home/pgee/scripts/sync.sh && shutdown +2
initially i tried having the shutdown
command in the script sync.sh
the script runs fine, but the computer never shuts down.
if i execute sudo shutdown +2
from the command line (over ssh) then the computer shuts down as expected.
any clues where to look to see why the script doesn't work?