45 lines
1.5 KiB
Bash
45 lines
1.5 KiB
Bash
#!/bin/bash
|
|||
|
|
|
||
|
|
#=================================================
|
||
|
|
# IMPORT GENERIC HELPERS
|
||
|
|
#=================================================
|
||
|
|
|
||
|
|
source _common.sh
|
||
|
|
source /usr/share/yunohost/helpers
|
||
|
|
|
||
|
|
ynh_print_info "Déclaration des fichiers à sauvegarder…"
|
||
|
|
|
||
|
|
#=================================================
|
||
|
|
# BACKUP THE APP MAIN DIR
|
||
|
|
#=================================================
|
||
|
|
|
||
|
|
ynh_backup "$install_dir"
|
||
|
|
|
||
|
|
#=================================================
|
||
|
|
# BACKUP THE DATA DIR
|
||
|
|
#=================================================
|
||
|
|
# C'est ici que vit tout le travail de veille accumulé : la base, son historique
|
||
|
|
# de passages et son cache. Le reste se reconstruit, pas ça.
|
||
|
|
#
|
||
|
|
# Le cache HTTP est volontairement exclu : il se régénère seul, se périme en
|
||
|
|
# six heures, et alourdirait l'archive pour rien.
|
||
|
|
|
||
|
|
ynh_backup "$data_dir/veille.db"
|
||
|
|
[ -f "$data_dir/textes.json" ] && ynh_backup "$data_dir/textes.json"
|
||
|
|
|
||
|
|
#=================================================
|
||
|
|
# BACKUP SYSTEM CONFIGURATION
|
||
|
|
#=================================================
|
||
|
|
|
||
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||
|
|
ynh_backup "/etc/systemd/system/$app.service"
|
||
|
|
ynh_backup "/etc/systemd/system/$app-pipeline.service"
|
||
|
|
ynh_backup "/etc/systemd/system/$app-pipeline.timer"
|
||
|
|
ynh_backup "/etc/logrotate.d/$app"
|
||
|
|
|
||
|
|
#=================================================
|
||
|
|
# END OF SCRIPT
|
||
|
|
#=================================================
|
||
|
|
|
||
|
|
ynh_print_info "Sauvegarde de $app déclarée. (YunoHost copie maintenant ces fichiers dans l'archive.)"
|