Hi Sven,

thanks, that's 99% of what I need (I'd found that thread before but didn't
really read it all the way because it looked like discussion going
nowhere). It still needs some tweaking, though, because it runs the backup
script whenever multiuser mode is left -- no matter if it's a shutdown or
reboot. In practise this doesn't make any significant difference though.

Regards,
robert

On Sun, Nov 13, 2016 at 9:26 PM, Sven Joachim <svenj...@gmx.de> wrote:

> On 2016-11-13 20:34 +0100, Robert Latest wrote:
>
> > I want to automatically start a data backup script (to USB or network
> > drive) at each shutdown of my computer. I did some research into this
> > and found that several people have the same problem as I do. But the
> > threads I found petered out into discussions of several ways of doing
> > this, working for some people and not for others.  So here I am
> > wondering if there is a canonical, proper and reliable method of doing
> > this.
> >
> > The script needs to run when a shutdown (but not a reboot) is started
> > while networking and USB mounts are still up, and (preferably)
> > multi-user mode has turned off. Perusing the systemd documentation I
> > found all kinds of good examples of how to start stuff in a well-ordered
> > manner to get the system up, but for shutting down there is quite little
> > information.
> >
> > How is it done?
>
> There is a possible answer on superuser.com[1], scroll towards the end.
>
> HTH,
>     Sven
>
>
> 1. http://superuser.com/questions/1016827/how-do-i-run-a-script-before-
> everything-else-on-shutdown-with-systemd
>
>

Reply via email to