sync /S /F creating empty directories

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\
 
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
12,425
153
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.
 
Thanks for that. Probably not worth the hassle when deleting them afterwards works. Just reading

"/F When used with /S, SYNC will not create any empty subdirectories"

depending on how you read it I thought it was a bug.
 

Similar threads

V
Replies
2
Views
1K
V