diff --git a/.config/snapborg/casaos_config.yaml b/.config/snapborg/casaos_config.yaml new file mode 100644 index 0000000..a89dc5f --- /dev/null +++ b/.config/snapborg/casaos_config.yaml @@ -0,0 +1,60 @@ +configs: + # MANDATORY: name of the snapper config + - name: root + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: root@casaos:/media/casaos/12TB_HDD/Backups/oryp7/root + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] + + # MANDATORY: name of the snapper config + - name: home + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: root@casaos:/media/casaos/12TB_HDD/Backups/oryp7/home + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] diff --git a/.config/snapborg/hdd_config.yaml b/.config/snapborg/hdd_config.yaml new file mode 100644 index 0000000..60500bd --- /dev/null +++ b/.config/snapborg/hdd_config.yaml @@ -0,0 +1,60 @@ +configs: + # MANDATORY: name of the snapper config + - name: root + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: /run/media/sravan/5TB_HDD/Backups/oryp7/root + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] + + # MANDATORY: name of the snapper config + - name: home + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: /run/media/sravan/5TB_HDD/Backups/oryp7/home + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] diff --git a/.scripts/backup.sh b/.scripts/backup.sh index 871dc6b..7439521 100755 --- a/.scripts/backup.sh +++ b/.scripts/backup.sh @@ -6,6 +6,7 @@ help_menu() { rofi_menu() { declare -a options=( " - backup-to-hdd" + " - backup-to-casaos" " Back - back" " Quit - quit" ) @@ -32,6 +33,9 @@ main() { --backup-to-hdd) kitty --hold /home/sravan/.scripts/backup_to_hdd.sh ;; + --backup-to-casaos) + kitty --hold /home/sravan/.scripts/backup_to_casaos.sh + ;; --rofi) rofi_menu ;; diff --git a/.scripts/backup_to_casaos.sh b/.scripts/backup_to_casaos.sh new file mode 100755 index 0000000..c58d4d5 --- /dev/null +++ b/.scripts/backup_to_casaos.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo snapborg --cfg /home/sravan/.config/snapborg/casaos_config.yaml backup diff --git a/.scripts/backup_to_hdd.sh b/.scripts/backup_to_hdd.sh index 24700ed..ab99425 100755 --- a/.scripts/backup_to_hdd.sh +++ b/.scripts/backup_to_hdd.sh @@ -1,6 +1,2 @@ #!/bin/bash -sudo snap-sync \ - --UUID fba0c463-99f4-41cf-8dc8-52a202a48849 \ - --subvolid 5 \ - --noconfirm \ - --quiet +sudo snapborg --cfg /home/sravan/.config/snapborg/hdd_config.yaml backup diff --git a/README.org b/README.org index ab7e11e..501cce5 100644 --- a/README.org +++ b/README.org @@ -80,6 +80,7 @@ - [[#backups][Backups]] - [[#rsync-options][Rsync Options]] - [[#hdd][HDD]] + - [[#casaos][CasaOS]] - [[#rofi-menu][Rofi Menu]] - [[#syncthing][Syncthing]] - [[#user-programs][User Programs]] @@ -7526,12 +7527,148 @@ inhibit_screensaver=1 *** HDD +**** Script + #+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_to_hdd.sh -sudo snap-sync \ - --UUID fba0c463-99f4-41cf-8dc8-52a202a48849 \ - --subvolid 5 \ - --noconfirm \ - --quiet +sudo snapborg --cfg /home/sravan/.config/snapborg/hdd_config.yaml backup +#+END_SRC + +**** Configuration + +#+BEGIN_SRC yaml :tangle .config/snapborg/hdd_config.yaml +configs: + # MANDATORY: name of the snapper config + - name: root + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: /run/media/sravan/5TB_HDD/Backups/oryp7/root + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] + + # MANDATORY: name of the snapper config + - name: home + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: /run/media/sravan/5TB_HDD/Backups/oryp7/home + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] +#+END_SRC + +*** CasaOS + +**** Script + +#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_to_casaos.sh +sudo snapborg --cfg /home/sravan/.config/snapborg/casaos_config.yaml backup +#+END_SRC + +**** Configuration + +#+BEGIN_SRC yaml :tangle .config/snapborg/casaos_config.yaml +configs: + # MANDATORY: name of the snapper config + - name: root + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: root@casaos:/media/casaos/12TB_HDD/Backups/oryp7/root + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] + + # MANDATORY: name of the snapper config + - name: home + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: root@casaos:/media/casaos/12TB_HDD/Backups/oryp7/home + # if this is set to true, borg does not neccessarily fail when a backup fails + fault_tolerant_mode: true + # snapborg fails when the most recent snapshot transferred successfully is + # older than the time period given here. Set to '0d' to disable this behaviour + last_backup_max_age: 0d + # archive creation/storage options + storage: + # use either none or repokey encryption, defaults to none + encryption: none + # MANDATORY when using repokey: literal key passphrase or path to file + # containing the key passphrase. Ignored when using none encryption + encryption_passphrase: ~ + # compression configuration, see borg manual + compression: auto,zstd,4 + + # define retention settings for borg independently from snapper + retention: + keep_last: 1 + keep_hourly: 5 + keep_daily: 7 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] #+END_SRC *** Rofi Menu @@ -7544,6 +7681,7 @@ help_menu() { rofi_menu() { declare -a options=( " - backup-to-hdd" + " - backup-to-casaos" " Back - back" " Quit - quit" ) @@ -7570,6 +7708,9 @@ main() { --backup-to-hdd) kitty --hold /home/sravan/.scripts/backup_to_hdd.sh ;; + --backup-to-casaos) + kitty --hold /home/sravan/.scripts/backup_to_casaos.sh + ;; --rofi) rofi_menu ;;