[gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Alex Schuster
Hi there! I am currently putting extra backups to old hard drives I do no longer need for other purposes. After that I send the putput out ls -lR and du -m to my log directory so I can check what files are on which drive without having to attach the drive. Works, though a better method would

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Etaoin Shrdlu
On Sat, 29 Jan 2011 14:58:13 +0100 Alex Schuster wo...@wonkology.org wrote: Hi there! I am currently putting extra backups to old hard drives I do no longer need for other purposes. After that I send the putput out ls -lR and du -m to my log directory so I can check what files are on which

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Alex Schuster
Etaoin Shrdlu writes: On Sat, 29 Jan 2011 14:58:13 +0100 Alex Schuster wo...@wonkology.org wrote: Hi there! I am currently putting extra backups to old hard drives I do no longer need for other purposes. After that I send the putput out ls -lR and du -m to my log directory so I can

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Florian Philipp
Am 29.01.2011 14:58, schrieb Alex Schuster: Hi there! I am currently putting extra backups to old hard drives I do no longer need for other purposes. After that I send the putput out ls -lR and du -m to my log directory so I can check what files are on which drive without having to

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Etaoin Shrdlu
On Sat, 29 Jan 2011 15:27:59 +0100 Alex Schuster wo...@wonkology.org wrote: I just wrote a little script that does this, but it does not do the sparse file thing yet, and would have problems with newline in file names. And I guess someone already wrote such a utility? IIUC, try

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Alex Schuster
Etaoin Shrdlu writes: On Sat, 29 Jan 2011 15:27:59 +0100 Alex Schuster wo...@wonkology.org wrote: I just wrote a little script that does this, but it does not do the sparse file thing yet, and would have problems with newline in file names. And I guess someone already wrote such a

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Etaoin Shrdlu
On Sat, 29 Jan 2011 17:45:30 +0100 Alex Schuster wo...@wonkology.org wrote: Ah, now I get it. There's a -c missing after the sh command. Right, thans for spotting it. I should have added that, to do it safely, the target should reside higher than the source in the hierarchy, or it should

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Alex Schuster
Florian Philipp writes: Use `truncate -s size file` It creates a sparse file if the specified file is smaller than the specified size. It will also create a new file if it does not yet exist. Nice one. First I did not see an improvement over using dd to create the sparse file, but in

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Florian Philipp
Am 29.01.2011 20:31, schrieb Alex Schuster: Florian Philipp writes: [...] For copying file attributes from one file to another you can use `cp --attributes-only`. Oh my, another case of a (german) man page that does not show all the possible arguments. Never heard about that, thanks!

Re: [gentoo-user] Cloning a directory hierarchy, but not the content

2011-01-29 Thread Alex Schuster
Etaoin Shrdlu writes: On Sat, 29 Jan 2011 17:45:30 +0100 Alex Schuster wo...@wonkology.org wrote: I should have added that, to do it safely, the target should reside higher than the source in the hierarchy, or it should be on a different filesystem and in that case -xdev should be specified