Simplest way to do it is to make the directories that you don't want to replicate be separate subvolumes. I do this to keep from replicating copies of snapshot directories.

Example:

mv /home/GEO/.cache /home/GEO/.cache.tmp
btrfs sub create /home/GEO/.cache
cp -a --reflink=always /home/GEO/.cache.tmp/ /home/GEO/.cache/
cp -a --reflink=always /home/GEO/.cache.tmp/.* /home/GEO/.cache/
rm -rf /home/GEO/.cache.tmp

You could also just mv the files instead of first doing cp and then rm'ing them, but if you have many gigs of files, the cp --reflink=always will be a win - currently (at least, last I checked) mv across subvolumes would actually do a full copy, whereas a cp --reflink=always will just create new pointers to the blocks in the appropriate place (thereby completing instantaneously).

Anyway, once .cache (or whatever) is a subvolume instead of a directory, it will no longer get replicated with your btrfs send command of its parent directory.

On 02/16/2014 03:07 PM, GEO wrote:
Hi,

I have been experimenting with btrfs send/receive for incremental backups, but
could not figure out how to exclude certain directories from
subvolumes/snapshots. For example, I want to backup my data in home, but I am
not interested in backing up hidden directories like .cache too.
Is it currently possible to achieve something like that?

Thanks for the great work!
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to