mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
Merge branch 'testing'
This commit is contained in:
commit
91313f4b4c
8 changed files with 12 additions and 30 deletions
10
README.md
10
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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue