Jump to content

Hey guys, im looking to setup like an auto-backup system on a mech 8tb drive.

 

What id like, if possible, is for it to auto back up when i shut down the PC. due to work commitments i can leave the house at any time and shut the PC down, so a scheduled BU wouldn't be ideal, but id need this done daily, and only yo back up any changes against the previous back up...

 

Any idea how i can setup such a system/if this is even possible? 

 

Thanks

Link to comment
https://linustechtips.com/topic/459518-silly-question-potentially/
Share on other sites

Link to post
Share on other sites

Simplest thing you can do is write a .bat that copies all files from place to place and include that in the shutdown process using Windows task scheduling.

this is beyond me - any idea on where i could find out how to do this? i know the basics of .bats, but no idea on how to impliment them into the shutdown process etc

Link to post
Share on other sites

this is beyond me - any idea on where i could find out how to do this? i know the basics of .bats, but no idea on how to impliment them into the shutdown process etc

Actually you implement the shutdown process into the .bat file itself.

 

Once it finishes copying all the files it goes on to shutting down your system. You'd be running the .bat file every time you want to back-up and shut down, instead of using the shutdown function itself

Remember kids, the only difference between screwing around and science is writing it down. - Adam Savage

 

PHOΞNIX Ryzen 5 1600 @ 3.75GHz | Corsair LPX 16Gb DDR4 @ 2933 | MSI B350 Tomahawk | Sapphire RX 480 Nitro+ 8Gb | Intel 535 120Gb | Western Digital WD5000AAKS x2 | Cooler Master HAF XB Evo | Corsair H80 + Corsair SP120 | Cooler Master 120mm AF | Corsair SP120 | Icy Box IB-172SK-B | OCZ CX500W | Acer GF246 24" + AOC <some model> 21.5" | Steelseries Apex 350 | Steelseries Diablo 3 | Steelseries Syberia RAW Prism | Corsair HS-1 | Akai AM-A1

D.VA coming soon™ xoxo

Sapphire Acer Aspire 1410 Celeron 743 | 3Gb DDR2-667 | 120Gb HDD | Windows 10 Home x32

Vault Tec Celeron 420 | 2Gb DDR2-667 | Storage pending | Open Media Vault

gh0st Asus K50IJ T3100 | 2Gb DDR2-667 | 40Gb HDD | Ubuntu 17.04

Diskord Apple MacBook A1181 Mid-2007 Core2Duo T7400 @2.16GHz | 4Gb DDR2-667 | 120Gb HDD | Windows 10 Pro x32

Firebird//Phoeniix FX-4320 | Gigabyte 990X-Gaming SLI | Asus GTS 450 | 16Gb DDR3-1600 | 2x Intel 535 250Gb | 4x 10Tb Western Digital Red | 600W Segotep custom refurb unit | Windows 10 Pro x64 // offisite backup and dad's PC

 

Saint Olms Apple iPhone 6 16Gb Gold

Archon Microsoft Lumia 640 LTE

Gulliver Nokia Lumia 1320

Werkfern Nokia Lumia 520

Hydromancer Acer Liquid Z220

Link to post
Share on other sites

this is beyond me - any idea on where i could find out how to do this? i know the basics of .bats, but no idea on how to impliment them into the shutdown process etc

 

Actually you implement the shutdown process into the .bat file itself.

 

Once it finishes copying all the files it goes on to shutting down your system. You'd be running the .bat file every time you want to back-up and shut down, instead of using the shutdown function itself

You can put the shutdown line at the end of the .bat script. "shutdown /t 0", I believe it is. Then place that on the desktop or in the taskbar and use it instead of the normal shutdown button.

However,I do think it won't work if there's a notepad open asking for save/don't save or something like that. Got too much going on ATM so I can't try it. :D

 

Task scheduler is IMHO pretty simple. You pick what will launch your event and what the event will do. The tricky thing is that startup is in the main list as task trigger but shutdown isn't. So if you want to run during shutdown (technically before shutdown and even before windows shuts down stuff like explorer.exe), make a custom trigger with Log: System, Source: User32, Event ID: 1074. I used this to run CCleaner on each shutdown and it worked fine in Win 7.

Do note that 1074 only accounts for user-initiated shutdowns so it won't trip if the system is set to shut down on a time delay or it reboots automatically due to updates and so on.

 

Find and run a program called "Task scheduler" and click "Create Basic Task..." from the right-hand menu called "Actions" to get started.

Link to post
Share on other sites

You'd probably be better served by using something like Macrium Reflect.  It has a free-for-personal-use edition, and you could set a backup to run on shutdown.
 

Macrium Reflect web page:

http://www.macrium.com/reflectfree.aspx
 

Shutdown scripts in Windows 7 (should work for 8 and 10, I think):

https://technet.microsoft.com/en-us/library/cc770300.aspx

 

There are lots of forum posts that walk through the process of starting a Macrium backup from CLI.  You'd add that command to the shutdown script using the second link above.

Alternatively, if you run Reflect manually, it has an option to shut down the PC after the backup finishes.  No logoff scripts, no batch files, etc.  :)

I'm sure other backup software can do something similar, I just happen to be familiar with Reflect.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×