removed backup links and versions folder

This commit is contained in:
2023-04-19 13:36:19 +02:00
parent 7cb11a2d37
commit 7361da8348
4 changed files with 47 additions and 56 deletions

View File

@@ -8,19 +8,22 @@ fi
# define executable commands
get_hashed_machine_id="sha256sum /etc/machine-id";
get_backup_types="find /Backups/{{hashed_machine_id.stdout}}/ -maxdepth 1 -type d -execdir basename {} ;";
hashed_machine_id="$($get_hashed_machine_id | head -c 64)"
get_backup_types="find /Backups/$hashed_machine_id/ -maxdepth 1 -type d -execdir basename {} ;";
# @todo This configuration is not scalable yet. If other backup services then docker-volume-backup are integrated, this logic needs to be optimized
get_static_last_version_dir="readlink -f /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/latest"
rsync_command="sudo rsync --server --sender -blogDtpre.iLsfxCIvu . $($get_static_last_version_dir)/"
get_version_directories="ls -d /Backups/$hashed_machine_id/docker-volume-backup/*"
last_version_directory="$($get_version_directories | tail -1)"
rsync_command="sudo rsync --server --sender -blogDtpre.iLsfxCIvu . $last_version_directory/"
# filter commands
case "$SSH_ORIGINAL_COMMAND" in
"$get_hashed_machine_id")
$get_hashed_machine_id
;;
"$get_static_last_version_dir")
$get_static_last_version_dir
"$get_version_directories")
$get_version_directories
;;
"$get_backup_types")
$get_backup_types

View File

@@ -11,10 +11,6 @@
group: backup
mode: '0700'
- name: register hashed_machine_id
shell: sha256sum /etc/machine-id | head -c 64
register: hashed_machine_id
- name: create /home/backup/.ssh/authorized_keys
template:
src: "authorized_keys.j2"
@@ -24,8 +20,8 @@
mode: '0644'
- name: create /home/backup/ssh-wrapper.sh
template:
src: "ssh-wrapper.sh.j2"
copy:
src: "ssh-wrapper.sh"
dest: /home/backup/ssh-wrapper.sh
owner: backup
group: backup