mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-10-09 22:41:13 +00:00
Website snapshot
This commit is contained in:
parent
ee0ab66d73
commit
50ec3688a5
281 changed files with 21066 additions and 0 deletions
22
content/blog/shutdownafterjob.md
Normal file
22
content/blog/shutdownafterjob.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: "Shutdown After Job"
|
||||
date: 2019-08-30T20:43:56-04:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
1. Change user to root.
|
||||
|
||||
```bash
|
||||
sudo su
|
||||
```
|
||||
|
||||
2. Run job as regular user, write output to file, and then poweroff.
|
||||
|
||||
```bash
|
||||
su -u user task > output.txt && chown user:user output.txt && poweroff
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue