2018-06-14 02:13:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2018-06-14 02:13:59 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2021-04-08 20:20:10 +02:00
|
|
|
#=================================================
|
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
|
|
|
#=================================================
|
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2024-08-12 13:03:41 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="$install_dir"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE DATA DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/home/$ssh_user/.ssh"
|
|
|
|
ynh_backup --src_path="/home/$ssh_user/.nobackup"
|
2021-04-08 20:20:10 +02:00
|
|
|
|
|
|
|
ynh_print_info --message="Borg backup repo in /home/$ssh_user/ won't be backup to avoid backup of backup loop issue."
|
|
|
|
|
2024-08-12 13:03:41 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP VARIOUS FILES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/cron.d/$app"
|
|
|
|
|
2021-04-08 20:20:10 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|