notes:backups
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| notes:backups [2021/10/03 20:31] – david | notes:backups [2024/08/31 23:29] (current) – [Prep backup server] david | ||
|---|---|---|---|
| Line 23: | Line 23: | ||
| make sure to use the " | make sure to use the " | ||
| "it can also help keep a copy-on-write | "it can also help keep a copy-on-write | ||
| + | |||
| + | ===== 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:// | ||
| + | < | ||
| + | cmd_cp | ||
| + | cmd_rm | ||
| + | </ | ||
| + | |||
| + | snapshot_plug_cp_btrfs ((https:// | ||
| + | <code bash rsnapshot_plug_cp_btrfs> | ||
| + | #!/bin/sh | ||
| + | # Arg 1: -al | ||
| + | # Arg 2: / | ||
| + | # Arg 3: / | ||
| + | btrfs subvolume snapshot $2 $3 | ||
| + | </ | ||
| + | |||
| + | rsnapshot_plug_rm_btrfs | ||
| + | ((https:// | ||
| + | <code bash rsnapshot_plug_rm_btrfs> | ||
| + | #!/bin/sh | ||
| + | |||
| + | # Arg 1: -rf | ||
| + | # Arg 2: / | ||
| + | |||
| + | # echo 1: $1 2: $@ | ||
| + | |||
| + | # Try to delete the given path with btrfs subvolume delete first | ||
| + | # if this fails fall back to normal rm | ||
| + | if [ " | ||
| + | # " | ||
| + | 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 | ||
| + | </ | ||
| + | https:// | ||
| ====== syncthing ====== | ====== syncthing ====== | ||
| Line 35: | Line 79: | ||
| < | < | ||
| mkdir -p / | mkdir -p / | ||
| - | chown gatewaybackups | + | chown gatewaybackup |
| </ | </ | ||
notes/backups.1633307498.txt.gz · Last modified: by david
