project:rsnapshot-zfs-helper
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | project:rsnapshot-zfs-helper [2018/02/22 18:35] – [preface] 92.75.65.74 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **CAVEAT : WORK IN PROGRESS ** | ||
+ | |||
+ | ====== rsnapshot zfs helper ====== | ||
+ | |||
+ | This is a plugin for rsnapshot (and of course rsnapshot-backup) to be used with zfs as storage backend. | ||
+ | |||
+ | ===== general idea ===== | ||
+ | |||
+ | The main objective why you may consider using zfs might be: | ||
+ | |||
+ | rsnapshot begins its job with creating a directory filled with hard links as " | ||
+ | which subseqently is updated with rsync. This ''' | ||
+ | around 10-20% of the total time the backup takes. Worse, it creates a lot of disk activity, putting stress | ||
+ | on hard drives, blocking concurrent backups and creating high loads on the backup system. To some extend | ||
+ | the deletion of expired backups will add to this overhead. | ||
+ | |||
+ | As zfs uses copy-on-write there is no need to somehow emulate this with ''' | ||
+ | |||
+ | ===== example for rsnapshot ====== | ||
+ | |||
+ | [[project: | ||
+ | |||
+ | ===== example for rsnapshot-backup ====== | ||
+ | |||
+ | [[project: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== details ==== | ||
+ | |||
+ | rsnapshot-zfs-helper is to be configured inside rsnapshot' | ||
+ | |||
+ | Additionally, | ||
+ | |||
+ | < | ||
+ | cmd_cp | ||
+ | cmd_preexec | ||
+ | cmd_postexec | ||
+ | </ | ||
+ | |||
+ | Example for creating a zpool: | ||
+ | < | ||
+ | ## | ||
+ | ## setup zfs (optional) | ||
+ | ## | ||
+ | # ' | ||
+ | apt-get install linux-image-amd64 | ||
+ | apt-get clean | ||
+ | reboot | ||
+ | |||
+ | - add " | ||
+ | apt-get update | ||
+ | apt-get install zfs-dkms zfsutils-linux | ||
+ | apt-get clean | ||
+ | |||
+ | / | ||
+ | |||
+ | ## create partition for zfs: | ||
+ | Device | ||
+ | ... | ||
+ | / | ||
+ | |||
+ | ## create zpool without mount point | ||
+ | zpool create zp-bak /dev/sda3 -m none | ||
+ | |||
+ | # create prereq. datasets | ||
+ | zfs create zp-bak/ | ||
+ | zfs create zp-bak/ | ||
+ | df | ||
+ | -> | ||
+ | | ||
+ | ... | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Create a zfs dataset for a single backup: | ||
+ | < | ||
+ | zfs create < | ||
+ | # e.g. | ||
+ | zfs create zp-bak/ | ||
+ | </ | ||
+ | |||
+ | Create cron jobs for backup promotion to higher rotation levels | ||
+ | < | ||
+ | 45 23 * * * root / | ||
+ | 50 23 * * 5 root / | ||
+ | 55 23 1 * * root / | ||
+ | </ | ||
+ | |||
+ | ===== how it works ===== | ||
+ | |||
+ | * '''/ | ||
+ | * the removal of expired backups using '' | ||
+ | * for the same reason, there will be no renaming or rotation of previous backups | ||
+ | * ''' | ||
+ | * '''/ | ||
+ | |||
+ | ===== FAQ ===== | ||
+ | |||
+ | * Why does ''' | ||
+ | * Why the weird ISO date format? **A:** because it's an international standard. Lots of code is available to handle it. It's human readable. It scales well. No built in misinterpretation. | ||
+ | * But why then use UTC? **A:** I would have preferred to use ISO-8601 with timezone notation. But zfs does not accept ' | ||
+ | * What's the deal with ''' | ||
+ | * Why is the .zfs subdir hidden (''' | ||
+ | |||
+ | |||
project/rsnapshot-zfs-helper.txt · Last modified: 2021/06/17 00:18 by 37.49.32.145