Struggling with FileSet Configuration for Wildcard directories in Path

42 views
Skip to first unread message

Julian Meyer

unread,
Mar 5, 2020, 4:44:56 AM3/5/20
to bareos-users
Hi,

im struggling with setting up a FileSet Configuration for a Cassandra Database Server. The Target is to backup the configuration of the server and the snapshot (= dumps of database) directories. 

I like to have this structure in my Backup:

/etc/ <- All Files and directories below
/opt/ <- All Files and directories below
/var/lib/cassandra/data/.*/.*/snapshots/* <- All Files under the snapshot directory, not before. But here have the wildcards in the path to be resolved. 


Example for the cassandra wildcard snapshots:
/var/lib/cassandra/data/<databasse1>/<table_a>/snapshots/db_file.1
/var/lib/cassandra/data/<databasse1>/<table_a>/snapshots/db_file.2
/var/lib/cassandra/data/<databasse1>/<table_a>/snapshots/db_file.3
/var/lib/cassandra/data/<databasse1>/<table_b>/snapshots/db_file.1
/var/lib/cassandra/data/<databasse1>/<table_b>/snapshots/db_file.2
/var/lib/cassandra/data/<databasse2>/<table_c>/snapshots/db_file.1
/var/lib/cassandra/data/<databasse2>/<table_c>/snapshots/db_file.2
/var/lib/cassandra/data/<databasse2>/<table_c>/snapshots/db_file.3


I know, I have to use excludes. I've tried many ways, but don't get it to run....

FileSet {
  Name = "LinuxDB_Cassandra"
  Include {
    Options {
      Signature = MD5 # calculate md5 checksum per file
      One FS = No     # change into other filessytems
      Compression = GZIP # Default of GZIP = GZIP6
      FS Type = btrfs
      FS Type = ext2  # filesystems of given types will be backed up
      FS Type = ext3  # others will be ignored
      FS Type = ext4
      FS Type = reiserfs
      FS Type = jfs
      FS Type = xfs
      FS Type = zfs
    }

    File = /etc
    File = /opt
    File = /var/lib/cassandra/data

    Options {
        RegexFile = "/var/lib/cassandra/data/.*/.*/.*"
        exclude = yes
        IgnoreCase = yes
    }
  }
}


I'm Using bareos 18.2.5 on Ubuntu 18.04 LTS

Hope someone can help me, or give me a good hint.

Best Regards,
Julian

Julian Meyer

unread,
Mar 9, 2020, 6:01:49 AM3/9/20
to bareos-users
Hi,

I found a solution that worked for me. I use a external program to find the directories:
    File = /etc
    File = /opt
    File = "\\|find /var/lib/cassandra/data -mindepth 2 -maxdepth 3 -type d -name snapshots"

maybe this helps some other people....

Regards
Julian

Andreas Rogge

unread,
Mar 9, 2020, 6:34:16 AM3/9/20
to bareos...@googlegroups.com
Am 05.03.20 um 10:44 schrieb Julian Meyer:
> Hi,
>
> im struggling with setting up a FileSet Configuration for a Cassandra
> Database Server. The Target is to backup the configuration of the server
> and the snapshot (= dumps of database) directories.

Add a second Include{}-Block to your Fileset and use WildFile to include
only the files you want:

Include {
Options {
WildFile = /var/lib/cassandra/data/*/*/snapshots/*
}
File = /var/lib/cassandra/data
}
(this is untested, but I think it should work)

You can see if that matches the files you want with "estimate
job=<jobname> listing"

Best Regards,
Andreas

--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, Philipp Storz

signature.asc
Reply all
Reply to author
Forward
0 new messages