If I run a background program (runs for 3 days) on a Linux server, and whilst it is running the server goes down for an hour, after that hour (when the server is up again) will my program resume running? or will be terminated due to the server going down whilst its execution?
Asked
Active
Viewed 301 times
3
1 Answers
3
When a server goes down, this typically means that it does either poweroff or at least reboots. Servers normally do not go in standby mode like you would configure on your laptop.
If the server goes down, your program stops and doesn't continue unless the server is suspended (which is unlikely). For long running processes it is best to design them so that they save intermediate states/results on a regular basis (e.g. every ten minutes) and are capable of continuing with the last saved data when restarted.

Anthon
- 79,293
rc.d
, Upstart, orsystemd
) or not. You may also want to look into the@reboot
directive incron
. – Jules May 18 '16 at 18:51