Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

sync /S /F creating empty directories

Jul
320
3
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
 
seems your del command would be better with...

del /a:d /s /e /x /y KnownToNotExist.txt
 
/a:d is a good safe guard but kept the /q to keep it quiet. My real question however, shouldn't /F not create the directories in the first place.
 
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
2K
Vovan
V
Back
Top