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

Number : 3497 Date : 2003-01-09 Author : yodaslo Subject : Re: Select files by Directory names Size(KB) : 4
Kan, What can I say? It's perfect!! Thank you so very much for the input once again, and well explained answer, as always. Rich --- In xxcopy@yahoogroups.com, Kan Yabumoto wrote: > > As to the date testing feature (/DA, /DB, etc.), they apply to > the timestamp of files, not directories, except for the /LTREE > command which selects and displays directories (never files). > Since nearly all XXCOPY commands are designed to work with > files, not directories as the real object of the action, > XXCOPY applies the date testing operation only on files > (this is mostly for avoiding confusion --- else we need > to have a full set of /DA/DB like switches that would work > on directories only). > > But, if you are talking about specifying the directory name > which happens to be encoded with a date value, you can use > the macro reference feature to do just that. > > E.g., the string, /$yyyy-mm-dd$ will be converted to the > current date (2003-01-08 for today). > > --------------------------------------------------------- > Note that even though the macro string starts with > the slash, it can be used as the name of the source > or destination directory specifier. > > Normally, in XCOPY's command syntax, when an item > starts with a slash is a switch. But with XXCOPY, > a slash that is followed by a dollar sign ($) denotes > the beginning of a macro reference and may be used > anywhere for any purpose within the XXCOPY command line. > > This (a bit awkward) syntactic rule is a result of > the very tight character allocation. That is, since > most characters are allowed for the filename (for LFN), > there are only a very few characters that can be used > to denote the beginning of the macro reference. > --------------------------------------------------------- > > For example, you may say > > xxcopy /$yyy-mm-dd$.zip \dest\ /s > > will be substituted to > > xxcopy 2003-01-08.zip > > Or, for Rich's examples, > > xxcopy c:\backup\/$yyyy-mm-dd$-1201p\mybackup.zip > > will be substituted to > > xxcopy c:\backup\2003-01-08-1201p\mybackup.zip > > Now, how can we choose a date macro other than today? > You may use /TM+ and /TM- to adjust the > macro value that is not today. > > For example, > > xxcopy c:\backup\/$yyyy-mm-dd$-1201p\mybackup.zip /tm-4 > > will give you the following line > > xxcopy c:\backup\2003-01-04-1201p\mybackup.zip > > For the /TM+ or /TM- parameters, the > can be specified in days, hours, minutes, or seconds > by adding the D, H, M, or S suffix letter at the end > (D is default and can be omitted). > > In conclusion, the macro reference feature can be used > to synthesize either directory name or file name which > is tied to the current date/time (or with an offset > value). > > Kan Yabumoto > ========================================================== > > At 2003-01-08 21:37, you wrote: > >Hello- > > > >Currently, I use some xxcopy batch programs that save files to a > >directory which then renames using winzip to reflect todays date. > > > >example > >2003-01-08-1201p > > > >Each day, the batch runs automatically, creating a new directory with > >the current days date. > > > >I end up with : > >2003-01-08-1201p > >2003-01-09-1201p > >2003-01-10-1201p > >2003-01-11-1201p > >etc > > > >After a period of time, I currently manually delete the older ones. > > > >I would like to automate this process now. > > > >I know xxcopy can distinguish dates using > >/DA:2001-10-30 // on or after > >/DB:2002-12-31 // on or before > >or > >/DA#10 // ten days ago or after > >/DB#7 // seven days or before > > > >as seen on Kan's recent post. > > > >Is there a switch in xxcopy which would work similar on directory > >names as it does on dates? This would allow a set of files not to be > >backed up after __ number of days. > > > >Using the switches for dates does not appear to be working for me, > >which could be the result of being copied nightly to another hard > >drive, c/o xxcopy. > > > >Any suggestions? > > > >Rich
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.