mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
fix: backup-restore
This commit is contained in:
parent
6a3580234d
commit
442d50b635
3 changed files with 24 additions and 15 deletions
|
@ -6,7 +6,7 @@
|
||||||
"en": "Backup your server with restic.",
|
"en": "Backup your server with restic.",
|
||||||
"fr": "Sauvegardez votre serveur avec restic."
|
"fr": "Sauvegardez votre serveur avec restic."
|
||||||
},
|
},
|
||||||
"version": "0.12.0~ynh2",
|
"version": "0.12.0~ynh3",
|
||||||
"url": "https://restic.net/",
|
"url": "https://restic.net/",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -19,12 +19,24 @@ ynh_abort_if_errors
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
export app=$YNH_APP_INSTANCE_NAME
|
||||||
|
export final_path="/opt/yunohost/${app}"
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP FILES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/usr/local/bin/backup-with-$app"
|
ynh_backup "/usr/local/bin/backup-with-$app"
|
||||||
ynh_backup "/etc/systemd/system/$app.service"
|
ynh_backup "/etc/systemd/system/$app.service"
|
||||||
ynh_backup "/etc/systemd/system/$app.timer"
|
ynh_backup "/etc/systemd/system/$app.timer"
|
||||||
|
ynh_backup "/etc/systemd/system/${app}_check.service"
|
||||||
|
ynh_backup "/etc/systemd/system/${app}_check.timer"
|
||||||
|
ynh_backup "/etc/systemd/system/${app}_check_read_data.service"
|
||||||
|
ynh_backup "/etc/systemd/system/${app}_check_read_data.timer"
|
||||||
ynh_backup "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
ynh_backup "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
||||||
|
ynh_backup "${final_path}/check_method_${app}"
|
||||||
|
ynh_backup "${final_path}/restic_log_${app}"
|
||||||
ynh_backup "/root/.ssh/id_${app}_ed25519"
|
ynh_backup "/root/.ssh/id_${app}_ed25519"
|
||||||
ynh_backup "/root/.ssh/id_${app}_ed25519.pub"
|
ynh_backup "/root/.ssh/id_${app}_ed25519.pub"
|
||||||
|
ynh_backup "/root/.ssh/config"
|
||||||
|
|
|
@ -20,9 +20,11 @@ ynh_abort_if_errors
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
export app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
server=$(ynh_app_setting_get $app server)
|
export server=$(ynh_app_setting_get $app server)
|
||||||
|
|
||||||
|
export final_path="/opt/yunohost/${app}"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL RESTIC
|
# INSTALL RESTIC
|
||||||
|
@ -43,14 +45,9 @@ ynh_restore
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENABLE TIMER
|
# ENABLE TIMER
|
||||||
#=================================================
|
#=================================================
|
||||||
systemctl --quiet enable $app.timer
|
systemctl enable --quiet ${app}.timer
|
||||||
systemctl start $app.timer
|
systemctl enable --quiet ${app}_check.timer
|
||||||
#yunohost service add $app.timer
|
systemctl enable --quiet ${app}_check_read_data.timer
|
||||||
#yunohost service enable $app.timer
|
systemctl start ${app}.timer
|
||||||
#yunohost service start $app.timer
|
systemctl start ${app}_check.timer
|
||||||
|
systemctl start ${app}_check_read_data.timer
|
||||||
#=================================================
|
|
||||||
# RESTORE SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
systemctl --quiet enable $app.service
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue