Robocopy - / XA: SH - exclude system, hidden directories?

It seems to work only with files. Or am I doing something wrong?

I tried to back up the user folder (C: \ Users \ XXX) in Vista, which contains a bunch of hidden / system folders. I used /XA:SHT

The "AppData" folder is "hidden", but not a "system", so it was not excluded.
Other special folders were "hidden" and "system", and they were excluded. But I'm not sure if this is due to the /XA:SHT that I used, or some other reason, for example right.

So my question is: does /XA apply to directories or files? Hopefully I don't need to manually enter all special folders using the /XD switch.

Thanks.

+6
source share
2 answers

According to the documentation /XA applies only to files.

eXclude files with any of these attributes

And to be sure - I just tested with Robocopy in RTM Windows 8, and the /XA:SH flag did not force Robocopy to ignore hidden directories.

I also use Robocopy to regularly back up my user directory, and also to exclude directory connection points (e.g. My Music ). I am using the /XJD flag. Also, to avoid copying AppData , I use the /XD flag.

My complete list of arguments is as follows: /MIR /FFT /Z /XA:SH /R:0 /LOG+:path\to\logfile.txt /TEE /XJD /NP /XD AppData

For reference to the argument, see the documentation .

+12
source

You can try using the /XD to exclude a directory based on a pattern. I found that using /XD *. excludes directories with dots. I combine it with XA:SH to exclude hidden files.

+1
source

Source: https://habr.com/ru/post/912253/


All Articles