View Full Version : Make a copy of Folders and Files but with empty files
Truman
08-02-2010, 09:29 AM
Hi,
I would like to recreate my hard drive structure on other computer, the tricky part is I would like my copied folders to contain all files but only as a place holder (touches, empty files). Just to keep record of my BackedUp date on external drives. I hope its clear.
I have
STRIPE/PROJECT/TEST/RENDERED/MOV/test.mov <size 2GB> and it contain some huge MOV files...
I would like to re-create that folder structure in other place but
STRIPE/PROJECT/TEST/RENDERED/MOV/test.mov <size Zero bytes>
I need to do it for multiple folders and hundreds of files so making it "by hand" using touch command or so is not an option for me ... I need to do it as automatic as possible.
MAC OSX 10.5.8
hayne
08-02-2010, 10:00 AM
You could do this easily enough with a script (I'd recommend a shell script instead of an AppleScript but either would do) but if all you want is a record of the dates, why not just have the script write the dates to a text file?
renaultssoftware
08-02-2010, 11:13 AM
You could give this (http://clientfoldermaker.com/) a try.
Truman
08-03-2010, 05:35 AM
You could do this easily enough with a script (I'd recommend a shell script instead of an AppleScript but either would do) but if all you want is a record of the dates, why not just have the script write the dates to a text file?
Oh I used date but it should be data in previous post
OK.
So to make it more clear. I would like to have a exact copy of my backed up projects on my computer but only with zero bytes files, It will make very easy to look for some past projects using Finder. On my computer I would create folder "ARCHIVE" or something and in it I would create folders "BACKUP DISK 01" "BACKUP DISK 02" ... and so on.... Then in each of this BACKUP DISK folders i would like to keep copy of folders structure (exact copy of folders structure of my external backup disk) with empty (zero bytes) files (a kind of aliases), and then If someone will ask me to bring project "MYPROJECT_200334" (or a project from which file "myvideo.mov" was created) from archive, I would go to my "ARCHIVE" folder and use finder search for a file "myvideo.mov" and then I will know that this file is on BACKUP DISK 02 in folder /MYPROJECTS_200334/AFX/RENDERED/ and then I can go to my archive-room and bring disk number 02 and find everything easy. Search criteria might be very different from date, file name, source materials name, afx project name etc.. . And If I will have copy of my backedup data on my computer its like having all projects on computer but with very very small disk space used for that.
I hope its clear enough..
And about script : I understand that maybe it should go like this
some command will make a list of all files and folders -> then some other will copy exact folder structure to given place -> then some command will take name of all files and create a "touch" for all this files in right place.
I can say what I wont but I have no such a scripting knowledge to translate my thoughts to language which will be understandable for computer.
I have found this % cp -r new-dir new-dir-2 and It should copy my folders structure with all included files, but now how to make all this files just a representation of original files (empty files or even aliases to original files).
cheers
renaultssoftware
08-03-2010, 06:57 AM
I'm thinking creating a BOM file (bill of materials) or even outputting results into a text file.
SirDice
08-03-2010, 10:39 AM
You guys make things way to complicated. Why not simply use mtree (http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man8/mtree.8.html)?
I think what you really want is a disk cataloguer - see the relevant section at Pure Mac (http://www.pure-mac.com/diskfile.html). The Finder (as an application) is not really designed to keep track of off-line media, and while you could hack something together as you're trying to do, you'd do better to get a tool made for the job.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.