diff --git a/restic/restic-init-local.sh b/restic/restic-init-local.sh deleted file mode 100644 index 5a9b350..0000000 --- a/restic/restic-init-local.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -export RESTIC_PASSWORD="8ung1e1!" - diff --git a/restic/restic-local/export-etc.sh b/restic/restic-local/export-etc.sh new file mode 100644 index 0000000..5892783 --- /dev/null +++ b/restic/restic-local/export-etc.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/etc" diff --git a/restic/restic-local/export-home-akanealw.sh b/restic/restic-local/export-home-akanealw.sh new file mode 100644 index 0000000..70a4673 --- /dev/null +++ b/restic/restic-local/export-home-akanealw.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/home/akanealw" diff --git a/restic/restic-local/export-opt.sh b/restic/restic-local/export-opt.sh new file mode 100644 index 0000000..9aa7b54 --- /dev/null +++ b/restic/restic-local/export-opt.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/opt" diff --git a/restic/restic-local/export-root.sh b/restic/restic-local/export-root.sh new file mode 100644 index 0000000..050b34c --- /dev/null +++ b/restic/restic-local/export-root.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/root" diff --git a/restic/restic-local/install-restic-local.sh b/restic/restic-local/install-restic-local.sh new file mode 100644 index 0000000..9fb36d0 --- /dev/null +++ b/restic/restic-local/install-restic-local.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +mkdir -p /root/scripts/restic > /dev/null 2>&1 +rm /root/scripts/restic/* > /dev/null 2>&1 +wget -q http://192.168.1.50/scripts/restic/restic-local/restic-local-backup.sh +wget -q http://192.168.1.50/scripts/restic/restic-local/export-etc.sh +wget -q http://192.168.1.50/scripts/restic/restic-local/export-home-akanealw.sh +wget -q http://192.168.1.50/scripts/restic/restic-local/export-opt.sh +wget -q http://192.168.1.50/scripts/restic/restic-local/export-root.sh +wget -q http://192.168.1.50/scripts/restic/restic-local/restic-local-init.sh + +mv /root/restic-local-* /root/scripts/restic +mv /root/export-* /root/scripts/restic +chmod +x /root/scripts/restic/* +sed -i "s/changemepls/$(cat /etc/hostname | tr '[:upper:]' '[:lower:]')/g" /root/scripts/restic/* diff --git a/restic/restic-local/restic-init-local.sh b/restic/restic-local/restic-init-local.sh new file mode 100644 index 0000000..400070b --- /dev/null +++ b/restic/restic-local/restic-init-local.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" + +restic -r /mnt/truenas-backups/resticbackups/changemepls/home/akanealw init +restic -r /mnt/truenas-backups/resticbackups/changemepls/etc init +restic -r /mnt/truenas-backups/resticbackups/changemepls/opt init +restic -r /mnt/truenas-backups/resticbackups/changemepls/root init + diff --git a/restic/restic-local/restic-local-backup.sh b/restic/restic-local/restic-local-backup.sh new file mode 100644 index 0000000..3fc3637 --- /dev/null +++ b/restic/restic-local/restic-local-backup.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" + +# backup /home/akanealw +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/home/akanealw" +restic unlock +restic backup /home/akanealw --no-cache -v +restic unlock +restic forget --keep-last 25 --prune + +# backup /etc +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/etc" +restic unlock +restic backup /etc --no-cache -v +restic unlock +restic forget --keep-last 25 --prune + +# backup /opt +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/opt" +restic unlock +restic backup /opt --no-cache -v +restic unlock +restic forget --keep-last 25 --prune + +# backup /root +export RESTIC_REPOSITORY="/mnt/truenas-backups/resticbackups/changemepls/root" +restic unlock +restic backup /root --no-cache -v +restic unlock +restic forget --keep-last 25 --prune diff --git a/restic/restic-init-lxc.sh b/restic/restic-lxc/restic-init-lxc.sh similarity index 100% rename from restic/restic-init-lxc.sh rename to restic/restic-lxc/restic-init-lxc.sh