diff --git a/.config/snapborg/hdd_config.yaml b/.config/snapborg/hdd_config.yaml deleted file mode 100644 index 2959dfb..0000000 --- a/.config/snapborg/hdd_config.yaml +++ /dev/null @@ -1,60 +0,0 @@ -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: 1 - keep_daily: 1 - keep_weekly: 1 - keep_monthly: 1 - keep_yearly: 1 - # 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: 0 - keep_daily: 0 - keep_weekly: 0 - keep_monthly: 0 - keep_yearly: 0 - # exclude patterns (see borg help patterns) - exclude_patterns: [] diff --git a/.config/snapborg/home_fileserver_config.yaml b/.config/snapborg/home_fileserver_config.yaml new file mode 100644 index 0000000..21f4ec6 --- /dev/null +++ b/.config/snapborg/home_fileserver_config.yaml @@ -0,0 +1,29 @@ +configs: + - name: home + # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame + repo: /mnt/fileserver/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: 0 + keep_daily: 0 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] diff --git a/.config/snapborg/home_hdd_config.yaml b/.config/snapborg/home_hdd_config.yaml new file mode 100644 index 0000000..01fcd15 --- /dev/null +++ b/.config/snapborg/home_hdd_config.yaml @@ -0,0 +1,29 @@ +configs: + - 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: 0 + keep_daily: 0 + keep_weekly: 0 + keep_monthly: 0 + keep_yearly: 0 + # exclude patterns (see borg help patterns) + exclude_patterns: [] diff --git a/.config/snapborg/fileserver_config.yaml b/.config/snapborg/root_fileserver_config.yaml similarity index 50% rename from .config/snapborg/fileserver_config.yaml rename to .config/snapborg/root_fileserver_config.yaml index 68aa402..53b1f2f 100644 --- a/.config/snapborg/fileserver_config.yaml +++ b/.config/snapborg/root_fileserver_config.yaml @@ -28,33 +28,3 @@ configs: keep_yearly: 1 # 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: /mnt/fileserver/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: 0 - keep_daily: 0 - keep_weekly: 0 - keep_monthly: 0 - keep_yearly: 0 - # exclude patterns (see borg help patterns) - exclude_patterns: [] diff --git a/.config/snapborg/root_hdd_config.yaml b/.config/snapborg/root_hdd_config.yaml new file mode 100644 index 0000000..c915bbb --- /dev/null +++ b/.config/snapborg/root_hdd_config.yaml @@ -0,0 +1,28 @@ +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 + retention: + keep_last: 1 + keep_hourly: 1 + keep_daily: 1 + keep_weekly: 1 + keep_monthly: 1 + keep_yearly: 1 + # exclude patterns (see borg help patterns) + exclude_patterns: [] diff --git a/.scripts/backup.sh b/.scripts/backup.sh index d9fefa0..bc196c8 100755 --- a/.scripts/backup.sh +++ b/.scripts/backup.sh @@ -5,8 +5,10 @@ help_menu() { rofi_menu() { declare -a options=( - "󰋊 - backup-to-hdd" - "󰒍 - backup-to-fileserver" + "󰋊 - backup-root-to-hdd" + "󰋊 - backup-home-to-hdd" + "󰒍 - backup-root-to-fileserver" + "󰒍 - backup-home-to-fileserver" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -30,11 +32,17 @@ main() { --help | -h) help_menu ;; - --backup-to-hdd) - kitty --hold /home/sravan/.scripts/backup_to_hdd.sh + --backup-root-to-hdd) + kitty --hold /home/sravan/.scripts/backup_root_to_hdd.sh ;; - --backup-to-fileserver) - kitty --hold /home/sravan/.scripts/backup_to_fileserver.sh + --backup-home-to-hdd) + kitty --hold /home/sravan/.scripts/backup_home_to_hdd.sh + ;; + --backup-root-to-fileserver) + kitty --hold /home/sravan/.scripts/backup_root_to_fileserver.sh + ;; + --backup-home-to-fileserver) + kitty --hold /home/sravan/.scripts/backup_home_to_fileserver.sh ;; --rofi) rofi_menu diff --git a/.scripts/backup_home_to_fileserver.sh b/.scripts/backup_home_to_fileserver.sh new file mode 100755 index 0000000..70e98d6 --- /dev/null +++ b/.scripts/backup_home_to_fileserver.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo snapborg --cfg /home/sravan/.config/snapborg/home_fileserver_config.yaml backup diff --git a/.scripts/backup_home_to_hdd.sh b/.scripts/backup_home_to_hdd.sh new file mode 100755 index 0000000..5ca411e --- /dev/null +++ b/.scripts/backup_home_to_hdd.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo snapborg --cfg /home/sravan/.config/snapborg/home_hdd_config.yaml backup diff --git a/.scripts/backup_root_to_fileserver.sh b/.scripts/backup_root_to_fileserver.sh new file mode 100755 index 0000000..0d97e9d --- /dev/null +++ b/.scripts/backup_root_to_fileserver.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo snapborg --cfg /home/sravan/.config/snapborg/root_fileserver_config.yaml backup diff --git a/.scripts/backup_root_to_hdd.sh b/.scripts/backup_root_to_hdd.sh new file mode 100755 index 0000000..369ba14 --- /dev/null +++ b/.scripts/backup_root_to_hdd.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo snapborg --cfg /home/sravan/.config/snapborg/root_hdd_config.yaml backup diff --git a/.scripts/backup_to_fileserver.sh b/.scripts/backup_to_fileserver.sh deleted file mode 100755 index 7131342..0000000 --- a/.scripts/backup_to_fileserver.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo snapborg --cfg /home/sravan/.config/snapborg/fileserver_config.yaml backup diff --git a/.scripts/backup_to_hdd.sh b/.scripts/backup_to_hdd.sh deleted file mode 100755 index ab99425..0000000 --- a/.scripts/backup_to_hdd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo snapborg --cfg /home/sravan/.config/snapborg/hdd_config.yaml backup diff --git a/README.org b/README.org index 25904ae..472ab7d 100644 --- a/README.org +++ b/README.org @@ -7531,15 +7531,17 @@ inhibit_screensaver=1 *** HDD -**** Script +**** Root -#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_to_hdd.sh -sudo snapborg --cfg /home/sravan/.config/snapborg/hdd_config.yaml backup +***** Script + +#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_root_to_hdd.sh +sudo snapborg --cfg /home/sravan/.config/snapborg/root_hdd_config.yaml backup #+END_SRC -**** Configuration +***** Configuration -#+BEGIN_SRC yaml :tangle .config/snapborg/hdd_config.yaml +#+BEGIN_SRC yaml :tangle .config/snapborg/root_hdd_config.yaml configs: # MANDATORY: name of the snapper config - name: root @@ -7559,8 +7561,6 @@ configs: 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: 1 @@ -7570,8 +7570,20 @@ configs: keep_yearly: 1 # exclude patterns (see borg help patterns) exclude_patterns: [] +#+END_SRC - # MANDATORY: name of the snapper config +**** Home + +***** Script + +#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_home_to_hdd.sh +sudo snapborg --cfg /home/sravan/.config/snapborg/home_hdd_config.yaml backup +#+END_SRC + +***** Configuration + +#+BEGIN_SRC yaml :tangle .config/snapborg/home_hdd_config.yaml +configs: - name: home # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame repo: /run/media/sravan/5TB_HDD/Backups/oryp7/home @@ -7604,15 +7616,17 @@ configs: *** Fileserver -**** Script +**** Root -#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_to_fileserver.sh -sudo snapborg --cfg /home/sravan/.config/snapborg/fileserver_config.yaml backup +***** Script + +#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_root_to_fileserver.sh +sudo snapborg --cfg /home/sravan/.config/snapborg/root_fileserver_config.yaml backup #+END_SRC -**** Configuration +***** Configuration -#+BEGIN_SRC yaml :tangle .config/snapborg/fileserver_config.yaml +#+BEGIN_SRC yaml :tangle .config/snapborg/root_fileserver_config.yaml configs: # MANDATORY: name of the snapper config - name: root @@ -7643,8 +7657,20 @@ configs: keep_yearly: 1 # exclude patterns (see borg help patterns) exclude_patterns: [] +#+END_SRC - # MANDATORY: name of the snapper config +**** Home + +***** Script + +#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .scripts/backup_home_to_fileserver.sh +sudo snapborg --cfg /home/sravan/.config/snapborg/home_fileserver_config.yaml backup +#+END_SRC + +***** Configuration + +#+BEGIN_SRC yaml :tangle .config/snapborg/home_fileserver_config.yaml +configs: - name: home # MANDATORY: borg repo target, e. g. backupuser@backuphost:reponame repo: /mnt/fileserver/Backups/oryp7/home @@ -7684,8 +7710,10 @@ help_menu() { rofi_menu() { declare -a options=( - "󰋊 - backup-to-hdd" - "󰒍 - backup-to-fileserver" + "󰋊 - backup-root-to-hdd" + "󰋊 - backup-home-to-hdd" + "󰒍 - backup-root-to-fileserver" + "󰒍 - backup-home-to-fileserver" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -7709,11 +7737,17 @@ main() { --help | -h) help_menu ;; - --backup-to-hdd) - kitty --hold /home/sravan/.scripts/backup_to_hdd.sh + --backup-root-to-hdd) + kitty --hold /home/sravan/.scripts/backup_root_to_hdd.sh ;; - --backup-to-fileserver) - kitty --hold /home/sravan/.scripts/backup_to_fileserver.sh + --backup-home-to-hdd) + kitty --hold /home/sravan/.scripts/backup_home_to_hdd.sh + ;; + --backup-root-to-fileserver) + kitty --hold /home/sravan/.scripts/backup_root_to_fileserver.sh + ;; + --backup-home-to-fileserver) + kitty --hold /home/sravan/.scripts/backup_home_to_fileserver.sh ;; --rofi) rofi_menu