User Tools

Site Tools


project:rsnapshot-zfs-helper

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:rsnapshot-zfs-helper [2018/02/20 14:33] – [FAQ] 92.75.65.74project:rsnapshot-zfs-helper [2021/06/17 00:18] (current) 37.49.32.145
Line 25: Line 25:
 [[project:rsnapshot-zfs-helper:rsnapshot-backup-example|Example for using rsnapshot-zfs-helper with rsnapshot-backup]] [[project:rsnapshot-zfs-helper:rsnapshot-backup-example|Example for using rsnapshot-zfs-helper with rsnapshot-backup]]
  
-===== setup using rsnapshot-backup ===== 
  
-==== preface ==== 
  
-I'm using ''rsnapshot-backup'' which is basically a wrapper around rsnapshot. 
  
-It uses one setup per system to backup with one config, exclude and script file. 
-There are also individual backup and logging directories. 
-There is a scheduler which parallelizes backup runs and a configuration frontend 
-using template files to create the backup jobs. 
  
-There is also an enabling mechnism using symlinks. +==== Example for creating a zpool: ====
- +
-A typical backup job configuration consists of: +
- +
-<code> +
-/etc/rsnapshot-backup.d/conf.<BACKUP-CLIENT> +
-/etc/rsnapshot-backup.d/exclude.<BACKUP-CLIENT> +
-/etc/rsnapshot-backup.d/script.<BACKUP-CLIENT>    # optional +
-/etc/rsnapshot-backup.d/enabled/conf.<BACKUP-CLIENT> -> ../conf.<BACKUP-CLIENT> +
- +
-/backup/hosts/<BACKUP-CLIENT>/daily.0 +
-/backup/hosts/<BACKUP-CLIENT>/... +
-</code> +
- +
-Here, this all runs on Debian GNU/Linux, so the examples refer to this environment. +
- +
-==== details ==== +
- +
-rsnapshot-zfs-helper is to be configured inside rsnapshot's configuration files. i.e. '''/etc/rsnapshot-backup.d/conf.<BACKUP-CLIENT>''' +
- +
-Additionally, '''cmd_cp''' has to be set to '''/bin/true''' - so the "cp -al ..." is rendered harmless. +
- +
-<code> +
-cmd_cp        /bin/true +
-cmd_preexec   /usr/sbin/rsnapshot-zfs-helper /etc/rsnapshot-backup.d/enabled/conf.<BACKUP-CLIENT> preexec +
-cmd_postexec  /usr/sbin/rsnapshot-zfs-helper /etc/rsnapshot-backup.d/enabled/conf.<BACKUP-CLIENT> postexec +
-</code> +
- +
-Example for creating a zpool:+
 <code> <code>
 ## ##
Line 81: Line 46:
 /sbin/modprobe zfs /sbin/modprobe zfs
  
 +## caveat: this example (a single disk partition) is neither redundant nor exceptionally performant
 +## and serves for illustration purpose only! 
 ## create partition for zfs: ## create partition for zfs:
 Device     Boot   Start       End   Sectors  Size Id Type Device     Boot   Start       End   Sectors  Size Id Type
Line 90: Line 57:
  
 # create prereq. datasets # create prereq. datasets
-zfs create zp-bak/backup                        -o compression=lz4 -o snapdir=visible -o xattr=sa -o acltype=posixacl -o mountpoint=/backup +zfs create zp-bak/backup                        -o compression=lz4 -o snapdir=hidden -o xattr=sa -o acltype=posixacl -o mountpoint=/backup 
-zfs create zp-bak/backup/hosts                  -o compression=lz4 -o snapdir=visible -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts+zfs create zp-bak/backup/hosts                  -o compression=lz4 -o snapdir=hidden -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts
 df   df  
 -> ->
Line 100: Line 67:
 </code> </code>
  
 +## if you use rsnapshot you have to add the commands commands below
 +## if you use rsnapshot-backups the tool rsnapshot-backup-conf will handle those for you
 Create a zfs dataset for a single backup: Create a zfs dataset for a single backup:
 <code> <code>
-zfs create <ZPOOL>/backup/hosts/<BACKUP-CLIENT> -o compression=lz4 -o snapdir=visible -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts/<BACKUP-CLIENT>/daily.0+zfs create <ZPOOL>/backup/hosts/<BACKUP-CLIENT> -o compression=lz4 -o snapdir=hidden -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts/<BACKUP-CLIENT>/daily.0
 # e.g. # e.g.
-zfs create zp-bak/backup/hosts/srv42 -o compression=lz4 -o snapdir=visible -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts/srv42/daily.0+zfs create zp-bak/backup/hosts/srv42 -o compression=lz4 -o snapdir=hidden -o xattr=sa -o acltype=posixacl -o mountpoint=/backup/hosts/srv42/daily.0
 </code> </code>
  
Line 129: Line 98:
   * What's the deal with '''cmd_cp /bin/true'''? **A:** Think of it as NOOP.   * What's the deal with '''cmd_cp /bin/true'''? **A:** Think of it as NOOP.
   * Why is the .zfs subdir hidden ('''snapdir=hidden''')? **A:** Because rsync would traverse it and all the subsequent snapshots resulting in really bad performance.   * Why is the .zfs subdir hidden ('''snapdir=hidden''')? **A:** Because rsync would traverse it and all the subsequent snapshots resulting in really bad performance.
 +  * Where can I download rsnapshot-zfs-helper? **A:** https://www.fischglas.de/software/rsnapshot-zfs-helper/
  
  
  
project/rsnapshot-zfs-helper.1519133629.txt.gz · Last modified: 2018/02/20 14:33 by 92.75.65.74