Hi Guys,

Hoping the community can tell me what I am doing wrong-

I have the following backup batch file to backup my server’s data:

robocopy E:\Accounting /S F: /LOG+:BACKUP12102015.TXT

robocopy E:\Imports /S F: /LOG+:BACKUP12102015.TXT

robocopy E:\Planning /S F: /LOG+:BACKUP12102015.TXT

robocopy E:\Production /S F: /LOG+:BACKUP12102015.TXT

robocopy E:\Abacus /S F: /LOG+:BACKUP12102015.TXT

robocopy E:\SalesReps /S F: /LOG+:BACKUP12102015.TXT

My problem is this when I look at drive F: after the backup is completed, the parent folder is not created, and all the contents of the folders being backed up are created in drive F:.

What am I doing wrong?

TIA

2 Spice ups

Because you are not giving a target directory i.e, you need to do it as:

robocopy E:\Accounting F:\Account /S /r:1 /w:1 /LOG+:BACKUP12102015.TXT

I always use a /r:1 /w:1 (or zero, you’re choice) otherwise you will be pausing the default (I believe 10 seconds for x number of tries) - if you have a lot of open files, you’ll never get it done.

In my case, I use it to back up my profile folders on my laptop, but use /MIR instead:

robocopy “C:\Users\micha\Favorites” “F:\Users\Michael M Tallman\Favorites” /MIR /r:1 /w:1

This way, if a file is deleted on the source, it is then deleted on the target - otherwise, you could run into an overflow eventually. I can add the /LOG+:profilebackup.txt at the end if I wanted to.

To test it BEFORE running it live - add a /L switch, this will just do a dry run on the data and show you in the logs what gets backed up. If you see a lot of “EXTRA” files, that means you need to tweak it some more. If you see “Newer File”, then you’re golden - it just means that your source is newer than the target, so if there was a file updated, it would overwrite the older file on the target.

2 Spice ups