mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-12-23 19:41:04 +00:00
634 B
634 B
title | date | draft | tags | medium_enabled | |
---|---|---|---|---|---|
Shutdown After Job | 2019-08-30T20:43:56-04:00 | false |
|
true |
I'm back to running longer jobs as part of my research. If I run a task overnight, I want to conserve energy and not keep it running after I finish. I suppose this would also apply to cloud billing, you want it to do the job and then stop.
This technique will require you to have sudo privileges on the machine.
- Change user to root.
sudo su
- Run job as regular user, write output to file, and then poweroff.
su -u user task > output.txt && chown user:user output.txt && poweroff