Re: [Bacula-users] losing directory permissions and ownership

2009-10-28 Thread Martin Simmons
> On Wed, 28 Oct 2009 06:25:54 +0200, Avi Rozen said:
> 
> Martin Simmons wrote:
> > You need to match the parent directories themselves and then the contents of
> > owned-by-bacula:
> >
> > FileSet {
> >   Name = test-fileset
> >   Include {
> > Options {
> > # Match all directories leading up to the cherry picked directory
> > regexdir = "^/home$"
> > regexdir = "^/home/avrozen$"
> > regexdir = "^/home/avrozen/temp$"
> > regexdir = "^/home/avrozen/temp/bacula-test$"
> > regexdir = "^/home/avrozen/temp/bacula-test/owned-by-root$"
> > regexdir = 
> > "^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen$"
> > # Match the cherry picked directory itself
> > regexdir = 
> > "^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula$"
> > # Match the contents of the cherry picked directory
> > wild = 
> > "/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/*"
> > }
> > Options {
> > # Skip everything else
> > wild = "*"
> > Exclude = yes
> > }
> > File = /
> >   }
> > }
> >
> > Note the $ at the end of each regexdir to make it match only the directory 
> > and
> > nothing else with that prefix.
> >
> > __Martin
> >
> >   
> Works! Thanks!
> 
> It also works if I replace regexdir with wilddir (and remove the ^ and $).

Ah, yes, wilddir will suffice here.  I was just overly cautious about wilddir
matching a prefix, but that only happens with a trailing *, for example
merging

wilddir = "/a/b/c/owned-by-bacula"
wild = "/a/b/c/owned-by-bacula/*"

into one line like this:

wild = "/a/b/c/owned-by-bacula*"

will spuriously match /a/b/c/owned-by-bacula-but-unwanted.

__Martin

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] losing directory permissions and ownership

2009-10-27 Thread Avi Rozen
Martin Simmons wrote:
> You need to match the parent directories themselves and then the contents of
> owned-by-bacula:
>
> FileSet {
>   Name = test-fileset
>   Include {
> Options {
> # Match all directories leading up to the cherry picked directory
> regexdir = "^/home$"
> regexdir = "^/home/avrozen$"
> regexdir = "^/home/avrozen/temp$"
> regexdir = "^/home/avrozen/temp/bacula-test$"
> regexdir = "^/home/avrozen/temp/bacula-test/owned-by-root$"
> regexdir = 
> "^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen$"
> # Match the cherry picked directory itself
> regexdir = 
> "^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula$"
> # Match the contents of the cherry picked directory
> wild = 
> "/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/*"
> }
> Options {
> # Skip everything else
> wild = "*"
> Exclude = yes
> }
> File = /
>   }
> }
>
> Note the $ at the end of each regexdir to make it match only the directory and
> nothing else with that prefix.
>
> __Martin
>
>   
Works! Thanks!

It also works if I replace regexdir with wilddir (and remove the ^ and $).

I actually tried something like that, since this is what you described
verbally, but I must have missed something, because it didn't seem to
work then. Too tired...

Thanks,
Avi.



signature.asc
Description: OpenPGP digital signature
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] losing directory permissions and ownership

2009-10-27 Thread Martin Simmons
> On Tue, 27 Oct 2009 00:22:37 +0200, Avi Rozen said:
> 
> Martin Simmons wrote:
> >>
> >> I'd like to cherry pick directories to backup and have them restored
> >> with correct ownership and permissions...
> >>
> >> What am I doing wrong? Is this the expected behavior?
> >> 
> >
> > Yes, this is the expected behavior.
> >
> > During a backup, Bacula looks inside the directories you give in the 'File 
> > ='
> > lines and doesn't save any information about the parents.
> >
> >   
> 
> Would be nice if it did...
> 
> > It is difficult to get the cherry picking behaviour, but I think it is
> > possible.  You need to start higher up the tree and use two Options clauses 
> > to
> > select the files to include and exclude.  The first Options clause must 
> > match
> > only what you want to back up (the parent directories themselves plus the
> > cherry picked files/directories, but not other contents of the parent
> > directories).  The second Options clause should use wild = "*" and 
> > Exclude=yes
> > to remove everything else.
> >   
> 
> Thanks for the explanation and tips.
> 
> I tried it and a few other file set configurations, based on the
> examples in [1], specifically the following, which is supposed to
> include only home directories of users whose usernames start with either
> 'a' or 'b':
> 
> FileSet {
>   Name = "Full Set"
>   Include {
>  Options {
> wilddir = "/home/a*"
> wilddir = "/home/b*"
>  }
>  Options {
> RegexDir = ".*"
> exclude = yes
>  }
>  File = /home
>   }
> }
> 
> But I can't get bacula to do what I want. I tried  the following file
> set to backup files in my test directory, but it excludes everything
> except for files in the root directory:
> 
> FileSet {
>   Name = test-fileset
>   Include {
> Options {
> wilddir =
> "/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula"
> }
> Options {
> regexdir = ".*"
> Exclude = yes
> }
> File = /
>   }
> }
> 
> Any ideas? What am I missing?

You need to match the parent directories themselves and then the contents of
owned-by-bacula:

FileSet {
  Name = test-fileset
  Include {
Options {
# Match all directories leading up to the cherry picked directory
regexdir = "^/home$"
regexdir = "^/home/avrozen$"
regexdir = "^/home/avrozen/temp$"
regexdir = "^/home/avrozen/temp/bacula-test$"
regexdir = "^/home/avrozen/temp/bacula-test/owned-by-root$"
regexdir = 
"^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen$"
# Match the cherry picked directory itself
regexdir = 
"^/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula$"
# Match the contents of the cherry picked directory
wild = 
"/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/*"
}
Options {
# Skip everything else
wild = "*"
Exclude = yes
}
File = /
  }
}

Note the $ at the end of each regexdir to make it match only the directory and
nothing else with that prefix.

__Martin

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] losing directory permissions and ownership

2009-10-26 Thread Avi Rozen
Martin Simmons wrote:
>>
>> I'd like to cherry pick directories to backup and have them restored
>> with correct ownership and permissions...
>>
>> What am I doing wrong? Is this the expected behavior?
>> 
>
> Yes, this is the expected behavior.
>
> During a backup, Bacula looks inside the directories you give in the 'File ='
> lines and doesn't save any information about the parents.
>
>   

Would be nice if it did...

> It is difficult to get the cherry picking behaviour, but I think it is
> possible.  You need to start higher up the tree and use two Options clauses to
> select the files to include and exclude.  The first Options clause must match
> only what you want to back up (the parent directories themselves plus the
> cherry picked files/directories, but not other contents of the parent
> directories).  The second Options clause should use wild = "*" and Exclude=yes
> to remove everything else.
>   

Thanks for the explanation and tips.

I tried it and a few other file set configurations, based on the
examples in [1], specifically the following, which is supposed to
include only home directories of users whose usernames start with either
'a' or 'b':

FileSet {
  Name = "Full Set"
  Include {
 Options {
wilddir = "/home/a*"
wilddir = "/home/b*"
 }
 Options {
RegexDir = ".*"
exclude = yes
 }
 File = /home
  }
}

But I can't get bacula to do what I want. I tried  the following file
set to backup files in my test directory, but it excludes everything
except for files in the root directory:

FileSet {
  Name = test-fileset
  Include {
Options {
wilddir =
"/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula"
}
Options {
regexdir = ".*"
Exclude = yes
}
File = /
  }
}

Any ideas? What am I missing?

Thanks,
Avi


[1]http://www.bacula.org/3.0.x-manuals/en/install/install/Configuring_Director.html#SECTION0067



> __Martin
>
> --
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>   




signature.asc
Description: OpenPGP digital signature
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] losing directory permissions and ownership

2009-10-26 Thread Martin Simmons
> On Mon, 26 Oct 2009 10:52:47 +0200, Avi Rozen said:
> 
> Hi,
> 
> I'm at my wits end here. I'd appreciate any feedback on this.
> 
> I have the following directory
> 
> /home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/bacula-test
> 
> with some files in it. I've specifically chowned the directories and
> files to different users and groups.
> 
> The relevant director configuration is at the bottom of this message.
> Note the single File directive pointing to the directory above.
> 
> When I restore the files all parent directories except for bacula-test
> lose their permissions and owner/group (all are set to 0751/drwxr-x--x
> root:root).
> 
> I'd like to cherry pick directories to backup and have them restored
> with correct ownership and permissions...
> 
> What am I doing wrong? Is this the expected behavior?

Yes, this is the expected behavior.

During a backup, Bacula looks inside the directories you give in the 'File ='
lines and doesn't save any information about the parents.

It is difficult to get the cherry picking behaviour, but I think it is
possible.  You need to start higher up the tree and use two Options clauses to
select the files to include and exclude.  The first Options clause must match
only what you want to back up (the parent directories themselves plus the
cherry picked files/directories, but not other contents of the parent
directories).  The second Options clause should use wild = "*" and Exclude=yes
to remove everything else.

__Martin

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] losing directory permissions and ownership

2009-10-26 Thread Avi Rozen
Hi,

I'm at my wits end here. I'd appreciate any feedback on this.

I have the following directory

/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/bacula-test

with some files in it. I've specifically chowned the directories and
files to different users and groups.

The relevant director configuration is at the bottom of this message.
Note the single File directive pointing to the directory above.

When I restore the files all parent directories except for bacula-test
lose their permissions and owner/group (all are set to 0751/drwxr-x--x
root:root).

I'd like to cherry pick directories to backup and have them restored
with correct ownership and permissions...

What am I doing wrong? Is this the expected behavior?

Please help,
Avi.



Job {
  Enabled = no
  Name = test-backup-job
  Client = machine-cycle-fd
  Type = Backup
  Level = Incremental
  Schedule = "WeeklyCycle"
  Storage = File
  Messages = Standard
  FileSet = test-fileset
  Pool = test-pool
  Full Backup Pool = test-full-pool
  Write Bootstrap = "/mnt/backup/test.bsr"
  Priority = 10
}

Job {
  Name = test-restore-job
  Client = machine-cycle-fd
  FileSet = test-fileset
  Type = Restore
  Storage = File
  Messages = Standard
  Pool = test-pool
  Full Backup Pool = test-full-pool
  Where = /tmp/bacula-restores
}

Pool {
  Name = test-pool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 4 months
  LabelFormat = "test-"
  Maximum Volume Bytes = 4294967295
}

Pool {
  Name = test-full-pool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 4 months
  LabelFormat = "test-full-"
  Maximum Volume Bytes = 4294967295
}

FileSet {
  Name = test-fileset
  Include {
Options {
  signature = SHA1
  compression = GZIP
}

File =
/home/avrozen/temp/bacula-test/owned-by-root/owned-by-avrozen/owned-by-bacula/bacula-test
  }
}

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users