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
 
Apr 2, 2011
1,442
10
54
North Carolina, USA
seems your del command would be better with...

del /a:d /s /e /x /y KnownToNotExist.txt
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
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
Thread starter Title Forum Replies Date
D SYNC /W copies back instead of propagating a delete Support 2
Alpengreis [v22.00.41] sync command flag "/X" does not work Support 22
Joe Caverly How to? Use SYNC with a network drive Support 4
M Sync folder/list view with command window? Support 2
R SYNC /T /W does not suppress "deleting" messages Support 0
V WAD SYNC command problem Support 2
CWBillow Sync Folder Tree and Command Window? Support 11
krischik SYNC crashes TCC Support 6
Peter Bratton Sync Surprise Support 6
D sync navigation between Folders List panel and the Tabs console Support 11
P Sync /w won't delete in ftp folder Support 1
A Inverse of CDD /t c:\ (sync TCC currdir to Folders view)? Support 9
N Problem with Sync? Support 0
Joe Caverly Problem creating and switching to a DESKTOP Support 9
robinsiebler Creating a custom prompt Support 9
C Language setup files, to use in creating similar for Multi-Edit Support 2
Jay Sage Creating or Editing TCMD Themes Support 6
Jay Sage Creating Files in Windows 7 Support 23
D Bug Can't delete empty temporary files. Support 2
gentzel Directory stack empty when running TCEXIT? Support 9
Chen Touboul When i try to delete an empty folder i got "the dirctoy name is invalid" Support 3
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
T input accepts empty answer Support 5
D Directory stack empty Support 1
vefatica Empty .watch files saved Support 0
M Forums appear empty if I'm not logged in Support 2
A How to? Frozen session tab with "ERROR: The file is either empty or does not contain the valid choices." Support 19
C How to? List empty folders Support 21
L WAD File-popup Window nearly empty Support 6
T dir /h error in empty directory Support 22
C MOVE making empty destinatation sub-folders Support 10
D LIST command wierdness with empty Unicode file Support 1
vefatica DO variable left with empty value Support 0
rconn Installer leaves directory empty Support 7
CWBillow Ditching empty folders Support 11
Charles Dye Create empty registry value? Support 5

Similar threads