638
Comment: first-line, }}}, and placeholder for pax
|
983
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
Line 3: | Line 4: |
Probably, the most easy to understand one, and the second "find" line does the same with files, creating their "dummy" copies, being empty, but having the original's modification and access times: . {{{ cd "$srcdir" find . -type d -exec mkdir -p "$destination"/{} \; find . -type f -exec touch -r {} "$destination"/{} \; }}} |
|
Line 5: | Line 14: |
{{{ | . {{{ |
Line 8: | Line 17: |
}}} | }}} |
Line 12: | Line 21: |
{{{ | . {{{ |
Line 16: | Line 25: |
}}} | }}} |
Line 20: | Line 29: |
''There should be a way to do this with `pax` too....'' - GreyCat | . ''There should be a way to do this with `pax` too....'' - GreyCat |
How can I recreate a directory structure, without the files?
Probably, the most easy to understand one, and the second "find" line does the same with files, creating their "dummy" copies, being empty, but having the original's modification and access times:
cd "$srcdir" find . -type d -exec mkdir -p "$destination"/{} \; find . -type f -exec touch -r {} "$destination"/{} \;
With the cpio program:
cd "$srcdir" find . -type d -print | cpio -pdumv "$dstdir"
or with GNU tar, and more verbose syntax:
cd "$srcdir" find . -type d -print | tar c --files-from - --no-recursion | tar x --directory "$dstdir"
This creates a list of directory names with find, non-recursively adds just the directories to an archive, and pipes it to a second tar instance to extract it at the target location.
There should be a way to do this with pax too.... - GreyCat