diff --git a/server/create_encrypted_rclone.sh b/server/create_encrypted_rclone.sh new file mode 100644 index 0000000..48ea923 --- /dev/null +++ b/server/create_encrypted_rclone.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# check for pwgen +if ! command -v pwgen >/dev/null 2>&1 +then + echo "pwgen could not be found" + source /etc/os-release + if [ "$ID" = "arch" ]; + then + sudo pacman -S pwgen + else + exit 1 + fi + +fi + +# check for rclone +if ! command -v rclone >/dev/null 2>&1 +then + echo "pwgen could not be found" + source /etc/os-release + if [ "$ID" = "arch" ]; + then + sudo pacman -S rclone + else + exit 1 + fi + +fi + +echo "---create unencrypted volume---" +sudo rclone config + +pwgen -sy --num-passwords=1 32 +echo "---create encrypted volume on previously created volume---" +sudo rclone config + +echo "Now initialize all repos with:" +echo "restic -r rclone:drive:path init" diff --git a/server/restic_backup_script_template.sh.template b/server/restic_backup_script_template.sh.template new file mode 100644 index 0000000..31bd89a --- /dev/null +++ b/server/restic_backup_script_template.sh.template @@ -0,0 +1,5 @@ +sudo -i -u root bash << EOF +export RESTIC_PASSWORD="RESTIC_PASSWORD_PLACEHOLDER" +export RESTIC_PROGRESS_FPS=0.01 +restic -r rclone:DRIVE:PATH --verbose backup LOCAL_PATH &> LOGFILE.log +EOF