From 7167f4455de06b3a88c0af59e8f9bc820e62f55e Mon Sep 17 00:00:00 2001 From: ljf Date: Thu, 27 Feb 2020 17:34:43 +0100 Subject: [PATCH] [fix] Remove old Data home optimization --- conf/17-data_home | 19 ------------------- manifest.json | 2 +- scripts/backup | 2 -- scripts/install | 2 -- scripts/restore | 1 - scripts/upgrade | 1 + 6 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 conf/17-data_home diff --git a/conf/17-data_home b/conf/17-data_home deleted file mode 100644 index f7a797b..0000000 --- a/conf/17-data_home +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Exit hook on subcommand error or unset variable -set -eu - -# Source YNH helpers -source /usr/share/yunohost/helpers.d/filesystem - -# Backup destination -backup_dir="${1}/data/home" - -# Backup user home -for f in $(find /home/* -type d -prune | awk -F/ '{print $NF}'); do - if [[ ! "$f" =~ ^yunohost|lost\+found ]]; then - if [ ! -e "/home/$f/.nobackup" ]; then - ynh_backup "/home/$f" "${backup_dir}/$f" 1 - fi - fi -done diff --git a/manifest.json b/manifest.json index 9ff44db..17d572c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Offer backup storage to a friend.", "fr": "Offrez un espace de stockage à un⋅e ami⋅e." }, - "version": "1.1.10~ynh1", + "version": "1.1.10~ynh2", "url": "https://borgbackup.readthedocs.io", "license": "BSD-3-Clause", "maintainer": { diff --git a/scripts/backup b/scripts/backup index 8a272f1..a50d340 100755 --- a/scripts/backup +++ b/scripts/backup @@ -20,5 +20,3 @@ ynh_abort_if_errors #================================================= app=$YNH_APP_INSTANCE_NAME - -ynh_backup "/etc/yunohost/hooks.d/backup/17-data_home" diff --git a/scripts/install b/scripts/install index 331f924..58bf2af 100755 --- a/scripts/install +++ b/scripts/install @@ -56,6 +56,4 @@ echo "command=\"borg serve $extra --restrict-to-repository /home/$ssh_user/backu # AVOID BACKUP OF BACKUP #================================================= touch $home/.nobackup -mkdir -p /etc/yunohost/hooks.d/backup -cp -f ../conf/17-data_home /etc/yunohost/hooks.d/backup/17-data_home diff --git a/scripts/restore b/scripts/restore index f3c5ecd..01756a1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,6 +53,5 @@ echo "command=\"borg serve $extra --restrict-to-repository /home/$ssh_user/backu # AVOID BACKUP OF BACKUP #================================================= touch $home/.nobackup -mkdir -p /etc/yunohost/hooks.d/backup ynh_restore diff --git a/scripts/upgrade b/scripts/upgrade index 914312b..5feee68 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,3 +39,4 @@ if is_stretch; then install_borg_with_pip fi +rm -f /etc/yunohost/hooks.d/backup/17-data_home