Backing up to USB drives

DorsetDude

Spud
Suspended / Banned
Messages
7,018
Name
Keith
Edit My Images
Yes
Bit of a long shot maybe..

I want to backup data to a USB drive. I also (will) have 4 usb drives the same size (64Gb). What I want to do is rotate the USB drives once a week.
I've set up an NTBackup task that is at the moment backing up happily to the "g" drive, which is the drive letter the computer allocated when I pluggd the USB in.
Question is, when I pull out the USB and insert a different one, will it still be G:? If not my automated script is no good. (I dont have the 4 USB drives yet so cant test)

Is it possible does anyone know?

Thanks.
 
Batch file

Create .txt file, rename as "backup.bat"

Copy the following into that file

::=============

if exist G: (
xcopy "C:\*.*" "G:\" /s /c /d /e /h /i /r /y /v
)

if exist H: (
xcopy "C:\*.*" "H:\" /s /c /d /e /h /i /r /y /v
)

if exist I: (
xcopy "C:\*.*" "I:\" /s /c /d /e /h /i /r /y /v
)

if exist J: (
xcopy "C:\*.*" "J:\" /s /c /d /e /h /i /r /y /v
)

if exist K: (
xcopy "C:\*.*" "K:\" /s /c /d /e /h /i /r /y /v
)

::=============

Swap C:\ for drive/folder path

Also place an identifying file on each backup drive, for example backup.txt, then change the "if exist" line to G:\backup.txt (etc) to avoid backups going to the wrong drives.

Who needs expensive backup software? ;D
In fact most backup software is merely a pretty interface for basic Windows commands.
Last company I worked for, I saved them almost £60'000 (corporate backup software + licenses and support) by writing 3 simple batch files.
 
Last edited:
cheers all.

I tried ntbackup and just specified a file on the G: drive as the destination rather than a tape and that worked.

Splicing that with Lyonsprides ideas could work out nicely.

Also apparently I can go into manage computer - disk drives and force the machine to use a certain drive letter for a USB drive. When/if we get all 4 in I may try to set them all to the same.
 
Also apparently I can go into manage computer - disk drives and force the machine to use a certain drive letter for a USB drive. When/if we get all 4 in I may try to set them all to the same.

Yeah, you can set drive letters to drives, but I think it's based on serial number, it assigns a letter to a drive serial number and then doesn't allow any other drive to use that letter.
But with that said, Windows has always done crazy daft things with assigning drive letters. Sometimes it seems entirely random....
 
If thats the case I'll use your idea and insert my 'ntbackup' stuff where you've used 'xcopy'.

:thumbs:
 
If thats the case I'll use your idea and insert my 'ntbackup' stuff where you've used 'xcopy'.

:thumbs:

That code might throw up a "No Disk" error on some PCs, i'm not sure why it does this, but it's no big deal breaker, simply hit continue.
 
xcopy - recover individual files easily
ntbackup - can compress, but not always easy to pull out individual files (depends on OS etc.)

Windows will generally give you the lowest available letter, so as long as you don't use other USB drives at the same time, it will nearly always get the same drive letter.
 
Bit of a long shot maybe..

I want to backup data to a USB drive. I also (will) have 4 usb drives the same size (64Gb). What I want to do is rotate the USB drives once a week.

Good to know that someone else use the grandfather back-up system, and that I'm not the only one.



Question is, when I pull out the USB and insert a different one, will it still be G:? If not my automated script is no good. (I dont have the 4 USB drives yet so cant test)

I've no idea but one thing I can tell you is that if you used 2 or more USB drives at the same time, the first one plugged in will stay letter G, but the others will be assigned new letters, such as H, etc., and it is possible that after that, the first one will stay G, but the rest (even when the first one is not plugged in) would still be H, etc.

So don't plug in your 4 USB drives at the same time or the system will give the other 3 its own letters, just make sure you use the Safe Remove icon and unplug, before plugging in the next one. (As a figure of speech example: As if it was a floppy disk, you remove one disk and pop in another but it stays letter A:, otherwise if you had two floppy drives, one floppy would be A: and the other floppy would be B: so if you want to back up to A: only, then pop in one floppy at a time.) But as far as I know, if Windows was still there, it may still assign the other drives with different letters unless you restart or turn off your computer.

Well, considering that you did say that you would back-up to different USB once a week, so most likely you're going to shut down your computer, next day, start it, work, shut down, the day after, start it, work, then back-up.
 
That code might throw up a "No Disk" error on some PCs, i'm not sure why it does this, but it's no big deal breaker, simply hit continue.
It would be quite a big deal as I will be settng it up to run as a non attended scheduled task. All the operator (me) has to do is make sure the USB drive is swapped before the backup starts. And I have alerts sent out from the script to remind me etc.

ps whats Grandfather backup system?
 
Old skool way of doing things.

You could backup via FTP, online storage, a NAS elsewhere.

If you only have 1 drive plugged in you will be fine, if you have a 2nd, then you will hit issues.
 
It would be quite a big deal as I will be settng it up to run as a non attended scheduled task. All the operator (me) has to do is make sure the USB drive is swapped before the backup starts. And I have alerts sent out from the script to remind me etc.

In that case there's a registry hack that'll suppress the error messages and as batch files can write to the registry, it could run before the script, then change the setting back afterwards :D
 
Do you 'name' each drive? I do and find that very useful as I always check before backing up that the name is in the right place so to speak.
 
ps whats Grandfather backup system?


It can be any media you want, be it floppy disks, Zip disk, CD, USB drives, whatever, but let's say for the sake of explaination, let's use floppy disks as an example.

The idea is that after doing some work on your computer, depending on how much work you do, how often your data changes, how often you back-up, you pop in a floppy which is the grandfather, and back up to it.

Next time you want to back up, you use another disk, this time call it the father disk.

You now have a disk that contents out of date data on grandfather disk, and a fresh backed up data on the father disk.

Next time you do back up, do it on the 3rd disk, call this the son disk.

The data on the grandfather disk could be days old (or a week or two old - depending on how often you back up), the data on the father disk is just a few days old, the data on the son disk is just one day old or two.

Something go wrong with your computer, just restore from the son disk.

But the trick is that supposing something had gone wrong with the son disk? Maybe you backed up the data which includes viruses onto the son disk, so after formating the hard drive and reinstalling the software, if you restore your data from the son disk, you could risk reinstalling the virus.

You could chose to not restore from the son, and if you're willing to put up with the lose of a few days of data, then restore from the father disk.

Even if the father disk is faulty or such, you could restore from the grandfather disk, if you don't care about losing a week's worth of data.

After backing up to grandfather, next back up should be on father, then after that, next one on son, then after that, the next back up should be overwriting on the grandfather, then do the father, and so on. Cycle around, grandfather, father, son, grandfather, father, son, and so on.

If your last back up was on the grandfather disk, and you find it faulty, then use the one before that, which is the son disk.

Something I learnt during my NVQ course about 20 years ago.
 
Last edited:
Back
Top