OK, progress on selective backup. "cpio" seems to do the trick pretty well when used with "find" (as the link I posted in my earlier backups conundrum thread suggested):
Code:
find . -not \( -name ".?*" -prune \) -not \( -type d -depth -empty -prune \) -mtime -7 | cpio -mdpv /path/to/destination
The tricky part is (of course) I am copying from an HFS+ volume with all kinds of tricksy resource forks and file naming weirdness.
The above is unfortunately still writing empty directories along with actual files+folders I want, and I've tried various iterations of -not -empty -prune.
Anyone have a handle on how to construct this to not write empty directories?
I suspect the empty folders were not empty at the time the find is run, and so they are copied empty (without "." contents).
Can I string together multiple find statements, so e.g. the 1st pass is 'cleaned', before piping to cpio?
Or not.
Code:
find . -not \( -name ".?*" -prune \) -mtime -7 | cpio -mdpv /path/to/destination/ && cd /path/to/destination && find . -type d -depth -empty -delete
Seems to get the job done.
EDITED: 10 Jul 2014 17:11 by DSMITHHFX