User Tools

Site Tools


notes:backups

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
notes:backups [2021/10/03 20:31] davidnotes:backups [2024/08/31 23:29] (current) – [Prep backup server] david
Line 23: Line 23:
 make sure to use the "--inplace" option for rsync when using the setup for btrfs, from the rsync man page make sure to use the "--inplace" option for rsync when using the setup for btrfs, from the rsync man page
 "it can also help keep  a  copy-on-write  filesystem  snapshot from diverging the entire contents of a file that only has minor changes" "it can also help keep  a  copy-on-write  filesystem  snapshot from diverging the entire contents of a file that only has minor changes"
 +
 +===== rsnapshot and btrfs =====
 +In order to take advantage of btrfs subvolumes with rsnapshot the following options in the rsnapshot configuration will need to be modified according to (( https://web.archive.org/web/20140409045559/http://wwerther.de/2011/10/migrate-rsnapshot-based-backup-to-btrfs-snapshots/ ))
 +<code>
 +cmd_cp      /root/bin/rsnapshot_plug_cp_btrfs
 +cmd_rm      /root/bin/rsnapshot_plug_rm_btrfs
 +</code>
 +
 +snapshot_plug_cp_btrfs ((https://gist.githubusercontent.com/wwerther/1306185/raw/rsnapshot_plug_cp_btrfs))
 +<code bash rsnapshot_plug_cp_btrfs>
 +#!/bin/sh
 +# Arg 1: -al
 +# Arg 2: /testbtrfs/backups/hourly.0
 +# Arg 3: /testbtrfs/backups/hourly.1
 +btrfs subvolume snapshot $2 $3
 +</code>
 +
 +rsnapshot_plug_rm_btrfs
 +((https://gist.githubusercontent.com/wwerther/1306189/raw/rsnapshot_plug_rm_btrfs))
 +<code bash rsnapshot_plug_rm_btrfs>
 +#!/bin/sh
 +
 +# Arg 1: -rf
 +# Arg 2: /testbtrfs/backups/hourly.4/
 +
 +# echo 1: $1  2: $@
 +
 +# Try to delete the given path with btrfs subvolume delete first
 +# if this fails fall back to normal rm
 +if [  "$1" = "-rf"  -a  "$3" = ""  ]; then
 +        # "trying to delete with btrfs"
 +        btrfs subvolume delete $2
 +        error=$?
 +        if [ $error -eq 13 ]; then
 +                # EC 13 => The directory specified is no subvolume
 +                rm $@
 +        elif [ $error -ne 0 ]; then
 +                echo Error while deleting with btrfs $?
 +        fi
 +else
 +        rm $@
 +fi
 +</code>
 +https://web.archive.org/web/20140409045559/http://wwerther.de/2011/10/migrate-rsnapshot-based-backup-to-btrfs-snapshots/
  
 ====== syncthing ====== ====== syncthing ======
Line 35: Line 79:
 <code> <code>
 mkdir -p /chrootbackup/gatewaybackup/backups mkdir -p /chrootbackup/gatewaybackup/backups
-chown gatewaybackups /chrootbackup/gatewaybackup/backups+chown gatewaybackup /chrootbackup/gatewaybackup/backups
 </code> </code>
  
notes/backups.1633307498.txt.gz · Last modified: by david