To find all new files and subfolders under some root folder (let us say Documents) and to copy them to other disk (J:
in this case)
Command line used:
robocopy c:\users\valery\documents j:\robocopy /XO /E /MAXAGE:20131030 /XD
Result: A full folders tree created. Only new files copyed, as supposed. It's good
A point is, that I do not want to create all subfolders on a target disk, if there are no new files in them.
Results are acceptable, but there is a lot of work to go through all folders and to find new files, as well, as to understand, what subfolders are a new ones
Answer
You can add /S
for that. You don't need the \E
which is for copy empty directories. You won't even need the \XO
which is done by the \MAXAGE
.
/S :: copy Subdirectories, but not empty ones.
When no files are copied in a directory, the directory is not created on the destination.
robocopy c:\users\valery\documents j:\robocopy /S /MAXAGE:20131030 /XD {directories_to_exclude}
If you don't have directories to exclude you can just use:
robocopy c:\users\valery\documents j:\robocopy /S /MAXAGE:20131030
You can do a robocopy /?
for all the help.
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/XD dirs [dirs]... :: eXclude Directories matching given names/paths.
/XO :: eXclude Older files.
/MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.
No comments:
Post a Comment