* BTRFS send: exclude directories
@ 2014-02-16 20:07 GEO
2014-02-16 20:32 ` WorMzy Tykashi
2014-02-16 20:44 ` Jim Salter
0 siblings, 2 replies; 3+ messages in thread
From: GEO @ 2014-02-16 20:07 UTC (permalink / raw)
To: linux-btrfs
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!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: BTRFS send: exclude directories
2014-02-16 20:07 BTRFS send: exclude directories GEO
@ 2014-02-16 20:32 ` WorMzy Tykashi
2014-02-16 20:44 ` Jim Salter
1 sibling, 0 replies; 3+ messages in thread
From: WorMzy Tykashi @ 2014-02-16 20:32 UTC (permalink / raw)
To: linux-btrfs
On 16 February 2014 20:07, GEO <1g2e3o4@gmail.com> 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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
You could create a read-write snapshot, remove the directories that
you're not interested in, then create a read-only snapshot of that to
send, then remove the read-write snapshot.
Note that I've not tested this myself, so I can't guarantee that it
will work. (It makes sense in my head though!)
Cheers,
WorMzy
(apologies if you receive this twice, I just noticed that gmail
doesn't reply to this mailing list, it replies to the person directly)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: BTRFS send: exclude directories
2014-02-16 20:07 BTRFS send: exclude directories GEO
2014-02-16 20:32 ` WorMzy Tykashi
@ 2014-02-16 20:44 ` Jim Salter
1 sibling, 0 replies; 3+ messages in thread
From: Jim Salter @ 2014-02-16 20:44 UTC (permalink / raw)
To: GEO, linux-btrfs
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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-16 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-16 20:07 BTRFS send: exclude directories GEO
2014-02-16 20:32 ` WorMzy Tykashi
2014-02-16 20:44 ` Jim Salter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.