[plug] Nightly Shutdown / Backup Scripts

Ben Jensz jensz at wn.com.au
Wed Feb 6 10:36:12 WST 2002


To add to what Peter said, if I ran:

/etc/backupscript.sh && shutdown -r now

That'd shutdown the computer after the first program/script has finished.
There is probably a cleaner way to do it (someone feel free to step in
anytime here :P), but I'm no programmer :P

I'm guessing that you're going into single user mode so that tar doesn't
have a sad if one of the files its reading gets modified whilst its reading
it?


/ Ben

----- Original Message -----
From: "Peter Wilsmore" <djinn at ucc.gu.uwa.edu.au>
To: <plug at plug.linux.org.au>
Sent: Wednesday, February 06, 2002 10:23 AM
Subject: Re: [plug] Nightly Shutdown / Backup Scripts


> On Wed, Feb 06, 2002 at 10:57:36AM +0800, Mark Nold wrote:
> > Is there a way i can shutdown to single user mode then kick of a script
> > (backups) then go back to level 3 or 5?
>
> The init command will let you switch between init levels. Check out man
> init. You should be able to write a script that will switch to runlevel s
> do the backup and then switch back.
>
> > Currently i have cron handling the shutdowns but i have to gues the time
it
> > takes tar to work, and id like my machine back up as soon as possible.
>
> Why? Run the shutdown at the end of the script that does the backup.
> Though I'm not really sure why your going to single user mode to backup
> anyway.
>
> thanks,
>   Peter
>



More information about the plug mailing list