![]()
[<<]Message[>>] [<<]Author [<<]Subject[>>] [<<]Thread[>>]
Number : 9130 Date : 2004-11-03 Author : jeremyrector66 Subject : Re: File rename revisited Size(KB) : 3
--- In xxcopy@yahoogroups.com, "Garry Deane" wrote: > > --- In xxcopy@yahoogroups.com, "jeremyrector66" > wrote: > > > > I am using XXCopy for backup (big surprise). I take a daily > > full /backup and hourly incrementals (based on file time/date). > > I am finding that putting the hourly backups into /$HH$00 > > folders is becoming a little bit unwieldy. I know that XXCopy > > does not do file renaming itself. I want to append > > "-/$YYMMDD$/$HH$00" to all files in a given directory tree > > and flatten the first directory layer (currently "/$HH$00"). > > I have seen several scripts for renaming files (notably from > > Garry Deane), but sadly making sense of the regular > > expressions used in these scripts is currently beyond me. :( > > > > I need something that I can give a directory name as an > > argument that will append "/$YYMMDD$/$HH$00-" to all files > > found under that directory tree and flatten the first layer > > (currently in the format 1100, 1200, 1300, etc) of directory. > > > > Any ideas? > > I'm sure that using either a batch file and/or the /SL switch > will be able to do what you want. However I can't quite > figure out what you're after. > > 1. Are you talking about converting your existing backup > directories to the new system or changing the way your > backups work so that they follow the new system? > > 2. Can you give some examples of the existing directory > structure and what you want these to be after the batch > file runs e.g. does your source directory look like the > following? > > \src\041103\file1.txt > \src\041103\dir1\file2.txt > \src\041103\0900\file1.txt > \src\041103\0900\dir1\file2.txt > \src\041103\1000\file1.txt > \src\041103\1000\dir1\file2.txt > > And you want then to become: > > \src\041103\file1.txt > \src\041103\dir1\file2.txt > \src\041103\0900-file1.txt > \src\041103\dir1\0900-file2.txt > \src\041103\1000-file1.txt > \src\041103\dir1\1000-file2.txt > > Garry Thanks for your response Garry. I have seen some of your other scripts for renaming files, but I know way too little about the sort of regular expression that you used. I plan on making this a learning experience. 1. I am actually looking to do both. All of my current backups use this scheme. Moving forward, I can do this to them. As time allows I can uncompress and convert my archives as well. 2. Very close. My source looks like this. \src\041103\0900\dir1\file1.txt \src\041103\0900\dir1\file2.txt \src\041103\1000\dir1\file1.txt \src\041103\1000\dir1\file2.txt \src\041103\1000\dir1\subdir1\file1.txt and I want it to look like this \src\dir1\file1-041103-0900.txt \src\dir1\file2-041103-0900.txt \src\dir1\file1-041103-1000.txt \src\dir1\file2-041103-1000.txt \src\dir1\subdir1\file1-041103-1000.txt This lets me use a single directory tree instead of multiples for dates and times. File versions sort out by date/time and I can see at a glance how many revisions there are, and recover the correct one without having to search through a separate tree for each day and seperate sub-tree's for every hour. My current system seemed like a good idea at the time.
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.