diff --git a/restic/restic-lxc/export-etc.sh b/restic/restic-lxc/export-etc.sh new file mode 100644 index 0000000..57faa1f --- /dev/null +++ b/restic/restic-lxc/export-etc.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/resticbackups/etc" diff --git a/restic/restic-lxc/export-home-akanealw.sh b/restic/restic-lxc/export-home-akanealw.sh new file mode 100644 index 0000000..5845dac --- /dev/null +++ b/restic/restic-lxc/export-home-akanealw.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/resticbackups/home/akanealw" diff --git a/restic/restic-lxc/export-opt.sh b/restic/restic-lxc/export-opt.sh new file mode 100644 index 0000000..f5ebdf4 --- /dev/null +++ b/restic/restic-lxc/export-opt.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/resticbackups/opt" diff --git a/restic/restic-lxc/export-root.sh b/restic/restic-lxc/export-root.sh new file mode 100644 index 0000000..14bcc87 --- /dev/null +++ b/restic/restic-lxc/export-root.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" +export RESTIC_REPOSITORY="/mnt/resticbackups/root" diff --git a/restic/restic-lxc/install-restic-lxc.sh b/restic/restic-lxc/install-restic-lxc.sh new file mode 100644 index 0000000..09a6235 --- /dev/null +++ b/restic/restic-lxc/install-restic-lxc.sh @@ -0,0 +1,12 @@ +#!/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-lxc/restic-lxc-backup.sh -P /root/scripts/restic +wget -q http://192.168.1.50/scripts/restic/restic-lxc/export-etc.sh -P /root/scripts/restic +wget -q http://192.168.1.50/scripts/restic/restic-lxc/export-home-akanealw.sh -P /root/scripts/restic +wget -q http://192.168.1.50/scripts/restic/restic-lxc/export-opt.sh -P /root/scripts/restic +wget -q http://192.168.1.50/scripts/restic/restic-lxc/export-root.sh -P /root/scripts/restic +wget -q http://192.168.1.50/scripts/restic/restic-lxc/restic-lxc-init.sh -P /root/scripts/restic + +chmod +x /root/scripts/restic/* diff --git a/restic/restic-lxc/restic-init-lxc.sh b/restic/restic-lxc/restic-init-lxc.sh deleted file mode 100644 index 5a9b350..0000000 --- a/restic/restic-lxc/restic-init-lxc.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -export RESTIC_PASSWORD="8ung1e1!" - diff --git a/restic/restic-lxc/restic-lxc-backup.sh b/restic/restic-lxc/restic-lxc-backup.sh new file mode 100644 index 0000000..9c41bdd --- /dev/null +++ b/restic/restic-lxc/restic-lxc-backup.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" + +# backup /home/akanealw +export RESTIC_REPOSITORY="/mnt/resticbackups/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/resticbackups/etc" +restic unlock +restic backup /etc --no-cache -v +restic unlock +restic forget --keep-last 25 --prune + +# backup /opt +export RESTIC_REPOSITORY="/mnt/resticbackups/opt" +restic unlock +restic backup /opt --no-cache -v +restic unlock +restic forget --keep-last 25 --prune + +# backup /root +export RESTIC_REPOSITORY="/mnt/resticbackups/root" +restic unlock +restic backup /root --no-cache -v +restic unlock +restic forget --keep-last 25 --prune diff --git a/restic/restic-lxc/restic-lxc-init.sh b/restic/restic-lxc/restic-lxc-init.sh new file mode 100644 index 0000000..3ef22cb --- /dev/null +++ b/restic/restic-lxc/restic-lxc-init.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +export RESTIC_PASSWORD="8ung1e1!" + +restic -r /mnt/resticbackups/home/akanealw init +restic -r /mnt/resticbackups/etc init +restic -r /mnt/resticbackups/opt init +restic -r /mnt/resticbackups/root init