sync /S /F creating empty directories

#1
Been playing with the sync command to backup a few files with the +A attribute. Seems to keep creating many empty subdirectories in the destination folder. However I did note if the target directory is empty it won't be created. So any ideas how I sync files without creating these empty directories.

sync /S /F /G /M /X E:\zzzz\ S:\zzzz\
 
#2
I'm now using the copy command rather than the sync command. I was hoping the /F wouldn't create empty directories when no files copied. It only not creates when the source directory is empty. I have solved this by deleting all empty directories afterwards. Would this be a bug or a feature request.


Code:
set n=%_datetime
copy  /SGMEFX E:\zzzz\ S:\backup\%n\zzzz\
cdd "S:\backup\%n\zzzz\"
cd \backup
del ashdkfsdf /xzsqe
 

rconn

Administrator
Staff member
May 14, 2008
10,588
97
#5
I was hoping the /F wouldn't create empty directories when no files copied. It only not creates when the source directory is empty. I have solved this by deleting all empty directories afterwards. Would this be a bug or a feature request.
Feature request -- and not a simple one, because SYNC would have to traverse the entire tree before deciding whether it should create the parent directories.