[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preventing the computer from shutting down.



Don Armstrong wrote:
> On Thu, 30 Oct 2014, Mario Castelán Castro wrote:
> > I can set up a script for backup with cron or anacron, but how can I
> > prevent the computer from shutting down while the backup is being
> > performed so as to not to leave it incomplete?.
> 
> If you're using systemd, this can be done using systemd-inhibit. See
> http://www.freedesktop.org/software/systemd/man/systemd-inhibit.html
> for details.
> 
> Quickly:
> 
> systemd-inhibit --who='backup script' --why='backup is running currently' \
>  --mode=block yourbackupscript;

This doesn't currently prevent either /sbin/shutdown or eg, the lightdm
menu item from shutting the system down. It does inhibit systemctl reboot/halt.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: