|
From: David K. <dj...@cy...> - 2018-03-31 10:49:21
|
On Sat, Mar 31, 2018 at 11:11:53AM +0100, Patrick O'Callaghan wrote:
> On 30 March 2018 at 23:12, David Keegel <[1]dj...@cy...> wrote:
>
> On Fri, Mar 30, 2018 at 06:20:58PM +0100, Patrick O'Callaghan wrote:
> > On 30 March 2018 at 14:47, Chris Dunn <[1][2]ch...@ic...>
> wrote:
> >
> > On Thu, 29 Mar 2018 16:53:51 +0100
> > "Patrick O'Callaghan" <[2][3]poc...@gm...> wrote:
> > > On 29 March 2018 at 15:48, Chris Dunn <[3][4]ch...@ic...>
> wrote:
> > >
> > > > I use SpiderOak for cloud backups and for each user the app
> creates
> > > > a "SpiderOak Hive" directory in the users home directory.
> > > >
> > > > I need to exclude these directories from my rsnapshot backups.
> > > >
> > > > At present I have a line in my config :
> > > >
> > > > "exclude<TAB>/home/ccc/SpiderOak\<TAB>Hive/<TAB>"
> > > >
> > > > That does not work. What should the correct line be for a
> directory
> > > > with a space in it's name?
> > >
> > >
> > > Looks like you're excluding directories with tabs in their name,
> > > which is not what you said.
> > >
> > > poc
> >
> > Not really. I tried using Spideroak\<SPC>Hive which I thought
> was
> > correct but that didn't work so realsing that rsnapshot config
> is
> > touchy about tabs being inserted correctly (not spaces), changed
> it
> > to
> > SpiderOak\<TAB>Hive and that didn't work either.
> I would try
> Spideroak<SPC>Hive
> (with no backslash, unless the backslash is literally part of the file
> name, which in Chris' case it isn't). That should work with some
> versions of rsnapshot, but not others.
> Another way to do this is to use "?" (single character wildcard) to
> match the space. I think that works in most (if not all) versions
> of rsnapshot. But there is a risk it might match SpideroakXHive
> (as unlikely as that sounds in this case).
> > I use 'exclude_file' rather than 'exclude' directly:
> > exclude_file<TAB>/etc/rsnaphot-exclude
> > Then in my /etc/rsnapshot-exclude file there's a line reading:
> > VirtualBox\ VMs/
> > and that works fine.
> I'm not sure if there should be a backslash there either, but I
> guess its easy to test whether it works with your local versions
> of rsnapshot and rsync.
>
> According to rsync(1):
> in a wildcard pattern, a backslash can be used to escape a wildcard
> character, but it is matched literally when no wildcards are present.
> This means that there is an extra level of back‐slash removal when a
> pattern contains wildcard characters compared to a pattern that has
> none. e.g. if you add a wildcard to "foo\bar" (which matches the
> backslash) you would need to use "foo\\bar*" to avoid the "\b" becoming
> just "b".
> So it turns out the \ in my example is wrong, as the pattern isn't
> matched using wildcards ('?', '*' and '[') and I'm inadvertently
> backing up those VMs! Luckily I don't use VirtualBox any more so
> there's only one copy. Thanks for the heads up.
> Going back to the OP's question, maybe try with a '/' at the end of the
> pattern?
> poc
He already had a '/' at the end.
I think OP (Chris) should use one of these:
exclude<TAB>/home/ccc/SpiderOak<SPC>Hive/
exclude<TAB>/home/ccc/SpiderOak?Hive/
and make sure there are no backslashes.
If those don't work, tell us which version of rsnapshot.
--
___________________________________________________________________________
David Keegel <dj...@cy...> Cyber IT Solutions Pty. Ltd.
http://www.cyber.com.au/~djk/ Linux & Unix Systems Administration
|