On Thu, Sep 26, 2024, at 7:02 AM, Marco Gaiarin wrote:
> Mandi! Arno Lehmann
>   In chel di` si favelave...
>
>> I have not looked up the discussion leading here.
>
> See my previous post: i'm fighting with ZFS. ;-)
>
>
>> What I usually prefer is a combination of a Run Script on the client to 
>> create a file list to back up, and a File= entry in the include list 
>> that reads from file or program, i.e. "\|" or "\<" ones.

That sounds exactly like what I do. I use the same script for three purposes: 
create list destroy:

>From 
>https://dan.langille.org/2023/12/24/backing-up-freebsd-with-bacula-via-zfs-snapshot/
> :

Job {
  Name            = "r730-01 snapshots"
  JobDefs         = "DefaultJob"
  Client          = r730-01-fd
  FileSet         = "r730-01 snapshots"
 
  RunScript {
    RunsWhen       = Before
    FailJobOnError = Yes
    Command        = "/usr/local/sbin/snapshots-for-backup.sh create"
  }
 
  RunScript {
    RunsWhen       = After
    FailJobOnError = No
    Command        = "/usr/local/sbin/snapshots-for-backup.sh destroy"
  }
}

Then in the FileSet:

FileSet {
  Name = "r730-01 snapshots"
 
  Ignore FileSet Changes = yes
 
  Include {
    Options {
      signature = MD5 
    }
 
    Exclude Dir Containing = .NOBACKUP
 
    File = "\\|/usr/local/sbin/snapshots-for-backup.sh list"
  }
}

Everything is in one place and consistent.

>
> OK, effectively i've just to run a script on the client to snapshot the FS
> and mount it RO, so it make sense to do that.

That is also what I do.  I backup the snapshot, which is mounted read-only - 
there is no other way to mount a ZFS snapshot. It is, by definition, read-only.

NOTE: There is no explicit mount required. See below.

> A question, indeed: normally if i modify fileset, bacula 'reset' itself and
> restart doing a Full backup.
> If i manage to get files from script or file, what happen?

I have 'Ignore FileSet Changes = yes' on my fileset.

> Or it is still the 'fileset change' the trigger, so scripts can make all the
> dumbest things, but bacula keep going on incrementals?

It doesn't all run as incrementals. If the list of DATASETS (see above URL) 
does not change, the fileset does not change.

> Also, if my script mount on '/some/dirs-202040926' and pass this as a backup
> dir for a full, but tomorrow script mount '/some/dirs-202040927' and calls
> for an incremental on that, i think will make still a new full...

If the output of that script is the same, the fileset is the same. It's not
the name of the script, it's the output.

> Seems to me there's no (easy) escape, and i need to mount snapshots on the
> same mountpoint to have working incrementals...

Oh wait, I think I realize something. The snapshots do not have to be 
explicitly mounted to be available for backup (at least on FreeBSD).

Here is an example.

[dvl@nagios03:~] $ cd /.zfs/snapshot
[dvl@nagios03:/.zfs/snapshot] $ ls -l
total 1122
drwxr-xr-x  18 root wheel 22 Jul 12 20:22 2024-07-12-20:29:47-0
drwxr-xr-x  18 root wheel 22 Sep  5 14:27 2024-09-25-10:55:42-0
drwxr-xr-x  18 root wheel 22 Sep  5 14:27 autosnap_2024-09-19_00:00:01_daily
drwxr-xr-x  18 root wheel 22 Sep  5 14:27 autosnap_2024-09-20_00:00:00_daily
drwxr-xr-x  18 root wheel 22 Sep  5 14:27 autosnap_2024-09-21_00:00:01_daily
...

There are all my snapshots.

Let's cd into one:

[dvl@nagios03:/.zfs/snapshot] $ cd 2024-07-12-20:29:47-0
[dvl@nagios03:/.zfs/snapshot/2024-07-12-20:29:47-0] $ ls
COPYRIGHT boot      entropy   home      libexec   mnt       proc      root      
tmp       var
bin       dev       etc       lib       media     net       rescue    sbin      
usr


There, it's all there. You don't have to mount anything.

Is this the problem you are trying to solve? mounting the snapshot to back it 
up?

-- 
  Dan Langille
  d...@langille.org


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to