diff --git a/README.md b/README.md index 270fa57..5ee3b52 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ Would you like to backup your YunoHost configuration ? [yes | no] (default: yes) Would you like to backup mails and user home directory ? [yes | no] (default: yes): Which apps would you backup (list separated by comma or 'all') ? (default: all): gitlab,blogotext,sogo Allow backup method to temporarily use more space? [yes | no] (default: yes): -Indicate the backup frequency (see systemd OnCalendar format) (default: Daily): *-*-* 0:05 -Indicate the backup check frequency (see systemd OnCalendar format) (default: *-*-8,15,22 3:15:00): -Indicate the complete backup check frequency (see systemd OnCalendar format) (default: *-*-1 1:15:00): +Indicate the backup frequency (see systemd OnCalendar format) (default: *-*-* 0:15:00): *-*-* 0:05 +Indicate the backup check frequency (see systemd OnCalendar format) (default: Sat *-*-8..31 3:15:00): +Indicate the complete backup check frequency (see systemd OnCalendar format) (default: Sun *-*-1..7 3:15:00): ``` You can schedule your backup by choosing an other frequency. Some example: @@ -128,7 +128,3 @@ yunohost app setting restic apps -v "nextcloud,wordpress" ## Backup on different server, and apply distinct schedule for apps You can setup the restic app several times on the same server so you can backup on several server or manage your frequency backup differently for specific part of your server. - -## TODO - -* Remove expect message when question was not matched diff --git a/conf/backup-with-restic-answerbot.j2 b/conf/backup-with-restic-answerbot.j2 deleted file mode 100644 index 20df760..0000000 --- a/conf/backup-with-restic-answerbot.j2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/expect -f -set timeout -1 -spawn /usr/local/bin/backup-with-{{ app }} -expect -re "Some files couldn't be prepared.*Do you agree?" -send -- "{% if allow_extra_space_use %}y{% else %}n{% endif %}\r" -expect eof diff --git a/conf/systemd.service b/conf/systemd.service index 1096d0e..db07912 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=oneshot -ExecStart=/usr/local/bin/backup-with-__APP__-answerbot +ExecStart=/usr/local/bin/backup-with-__APP__ ExecStartPost=/bin/bash -c 'echo -e "Subject: YunoHost Restic backup log on $(hostname)\n$(/bin/journalctl _SYSTEMD_INVOCATION_ID=`systemctl show -p InvocationID --value __APP__.service`)" | /usr/sbin/sendmail root' User=root Group=root diff --git a/manifest.json b/manifest.json index d5038b8..1d7ce1f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Backup your server with restic.", "fr": "Sauvegardez votre serveur avec restic." }, - "version": "0.9.6~ynh4", + "version": "0.9.6~ynh5", "url": "https://restic.net/", "license": "BSD 2-Clause \"Simplified\" License", "maintainer": { @@ -127,7 +127,7 @@ "fr": "Indiquez la fréquence de la sauvegarde (voir le format OnCalendar de systemd)" }, "example": "Daily", - "default": "Daily" + "default": "*-*-* 0:15:00" }, { "name": "check_on_calendar", @@ -137,7 +137,7 @@ "fr": "Indiquez la fréquence de vérification de la sauvegarde (voir le format OnCalendar de systemd)" }, "example": "Tue *-*-* 00:15:00", - "default": "*-*-8,15,22 3:15:00" + "default": "Sat *-*-8..31 3:15:00" }, { "name": "check_read_data_on_calendar", @@ -147,7 +147,7 @@ "fr": "Indiquez la fréquence de vérification complète de la sauvegarde (voir le format OnCalendar de systemd)" }, "example": "Tue *-*-* 00:15:00", - "default": "*-*-1 1:15:00" + "default": "Sat *-*-1..7 3:15:00" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index a4b60ba..dd1705a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,8 +7,6 @@ PKG_DIR=$(cd ../; pwd) RESTIC_VERSION="0.9.6" -pkg_dependencies="expect" - # Install restic if restic is not here install_restic () { architecture=$(uname -m) diff --git a/scripts/install b/scripts/install index b37ee06..15f9f7e 100755 --- a/scripts/install +++ b/scripts/install @@ -31,11 +31,9 @@ ynh_export server port ssh_user backup_path passphrase on_calendar check_on_cale ynh_save_args server port ssh_user backup_path passphrase on_calendar check_on_calendar check_read_data_on_calendar conf data apps allow_extra_space_use #================================================= -# INSTALL DEPENDENCIES +# INSTALL RESTIC #================================================= -ynh_script_progression --message="Installing dependencies" --weight=7 -ynh_install_app_dependencies $pkg_dependencies -ynh_script_progression --message="Installing restic binary" --weight=4 +ynh_script_progression --message="Installing restic binary" --weight=7 install_restic #================================================= @@ -57,10 +55,8 @@ ynh_configure check_method "${final_path}/check_method" #================================================= ynh_script_progression --message="Configuring cron" --weight=5 ynh_configure backup-with-restic "/usr/local/bin/backup-with-${app}" -ynh_configure backup-with-restic-answerbot "/usr/local/bin/backup-with-${app}-answerbot" ynh_configure check-restic "${final_path}/check-${app}" chmod u+x "/usr/local/bin/backup-with-${app}" -chmod u+x "/usr/local/bin/backup-with-${app}-answerbot" chmod u+x "${final_path}/check-${app}" chmod u+x "${final_path}/check_method" ynh_add_systemd_config --service=${app} --template=systemd.service diff --git a/scripts/restore b/scripts/restore index 7293e6a..c55046d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,9 +25,8 @@ app=$YNH_APP_INSTANCE_NAME server=$(ynh_app_setting_get $app server) #================================================= -# INSTALL DEPENDENCIES +# INSTALL RESTIC #================================================= -ynh_install_app_dependencies $pkg_dependencies install_restic #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index da9c116..83f9d45 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,7 +41,6 @@ if grep "restic.timer" /etc/yunohost/services.yml > /dev/null ; then fi #================================================= -# INSTALL DEPENDENCIES +# INSTALL RESTIC #================================================= -ynh_install_app_dependencies $pkg_dependencies install_restic