RoboCopy problem - backup folder turning into a hidden system folder

Soldato
Joined
2 May 2004
Posts
19,946
I've got a RoboCopy backup script that mirrors my portable external hard drive excluding some folders that don't need to be backed up.

Here's the code:
Code:
robocopy /MIR G:\ D:\PortableExternalBackup\Files\ /R:50 /W:10 /XA:SH /XD "$RECYCLE.BIN" "RECYCLER" "System Volume Information" "Cisco Apps" "Software"

I know the exclusion of $RECYCLE.BIN, RECYCLER etc. is probably not necessary now that I have XA:SH in there, but I've left it for now just in case (could someone confirm that excluding them isn't necessary when I use XA:SH?).

Anyway, once the mirror backup has been complete the destination folder disappears, I have to show both hidden folders and system files to find it again.

Any ideas why?

Thanks,
Craig.
 
Don
Joined
21 Oct 2002
Posts
46,750
Location
Parts Unknown
ms do recommend not doing robocopy at root level..


what i do..

open excel..

in A1..
robocopy /e

(fill down)

in B1
g:\folder1
g:\folder2
etc..

in c1
d:\backup\folder1
d:\backup\folder2


copy it all to notepad, then highlight one of the 'tab' spaces, and copy.
now do find and replace, and paste the 'tab' in and replace all with a 'space'

now you have a bat file with the multiple folder locations in

ie, i make a robocopy script for each folder i need backing up on the root dir
 
Soldato
OP
Joined
2 May 2004
Posts
19,946
Ah, OK, so do you just do the second level of directories rather than the top directory and leave it at that?

What's done with the files that are under the root directory, but not in a sub folder?

[Edit]
Just added the LEV:1 command to my first backup script to only backup the files in the root directory, however once the backup is complete the backup folder still becomes a hidden/system folder :(

I'm creating the directory manually before the RoboCopy runs (a lot of people on various websites have said that letting RoboCopy create the directory makes it a system/hidden folder).

[Edit]
Sorted with /A-:SH :)

Thanks,
Craig.
 
Last edited:

InQ

InQ

Associate
Joined
21 Oct 2003
Posts
1,665
Location
Preston
I ran into the same problem myself last night when copying from the root and was searching for a solution before i posted, looks like i'll need to add the /A-:SH switch then! :)

Craig321 said:
I know the exclusion of $RECYCLE.BIN, RECYCLER etc. is probably not necessary now that I have XA:SH in there, but I've left it for now just in case (could someone confirm that excluding them isn't necessary when I use XA:SH?).

Did you test this as i've just listed the hidden system files as well but havent tried the XA:SH switch?


Last question....does the XA:SH switch only omit files that have both these attributes or files that have either of these attributes?
(ie will it still copy non-system files that are hidden?)
 

InQ

InQ

Associate
Joined
21 Oct 2003
Posts
1,665
Location
Preston
OK found the answer...lol :rolleyes:

This is pretty good for Robocopy help:-
http://209.85.229.132/search?q=cach....doc+robocopy+/XA:SH&cd=2&hl=en&ct=clnk&gl=uk

Specifically:-
Furthermore, the /XA:[R][A][H] (eXclude Attributes) switch can be used to exclude files from being copied if one or more of the given attributes is set. For example, you could specify /XA:R to prevent Read-only files from being copied. Similarly, /XA:SH would prevent any files with either or both of the System or Hidden attributes set from being copied.

So it looks like it would omit anything thats a system OR a hidden file. As i want to copy some hidden files over then i will just set it to not copy any files with a system attribute set, /XA:S

Hope this is of help to someone. :)
 
Last edited:
Back
Top Bottom