[<<]Message[>>]        Author[>>]    [<<]Subject[>>]        Thread    

Number : 4535 Date : 2003-05-05 Author : daverunda Subject : (no subject) Size(KB) : 2
I have a batch file that uses XXCOPY to create a folder named %DATE% on my D: drive and copy the contents of my C:\DATA folder into the D:\ %DATE% folder. This system works great except that after a while I need to purge some of these old backup folders. I asked Kan if I can use XXCOPY to delete old folders on my D: drive based on the folder creation date. His reply is as follows: "First of all, currently, XXCOPY does not use the timestamp of a directory (except for /LTREE --- list-directory without copy). The date-related features are primarily for comparison of the timestamp of individual files rather than the timestamp of the parent directory...[however] you may take advantage of the fact that (I assume) if you create a directory on certain date, the files that are copied into the directory should have their file-creation date that is closely related to when the directory is made. Based on this fact, you may successfully select those files: xxcopy \src\ /rmdir /db#10 /fc Here, the /FC switch makes the /db#10 (10 days or older) to be compared using the creation date (the time when the file was copied into the directory). Although this may not exactly what you had in mind, unless you manipulate the contents of the files after the directory (such as \4-10-03\) was created, the creation-date comparison should work well." I tried Kan's suggestion and it works great with one exception: it deletes ALL empty folders, not just he ones that qualify (indirectly) via the DB#10. An empty folder that was created on the backup media 5 days ago will be deleted even though I'm using the DB#10 parameter. If ever I have to restore one of my D:\%DATE% folders to the C:\DATA, the restored folder will not be identical to that which was backed up in that the empty folders will be missing...in certain circumstances this could cause problems. Is there a work-around for this within XXCOPY? If not, could I combine XXCOPY with some other method (e.g. some batch file routine maybe) that would produce the desired results?
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.