2020-02-23 12:02:10 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-13 17:45:45 +01:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
|
|
|
source ../settings/scripts/_common.sh
|
2020-02-23 12:02:10 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
2020-02-23 12:02:10 +01:00
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2020-02-23 12:02:10 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
# BACKUP THE APP MAIN DIR
|
2020-02-23 12:02:10 +01:00
|
|
|
#=================================================
|
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_backup --src_path="$install_dir"
|
2020-02-23 12:02:10 +01:00
|
|
|
|
2022-03-13 17:45:45 +01:00
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
# SYSTEM CONFIGURATION
|
2022-03-13 17:45:45 +01:00
|
|
|
#=================================================
|
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
for suffix in "${systemd_services_suffixes[@]}"; do
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app$suffix.timer"
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app$suffix.service"
|
|
|
|
done
|
2020-02-23 12:02:10 +01:00
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_backup --src_path="/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
|
|
|
ynh_backup --src_path="/etc/sudoers.d/$app"
|
2021-03-07 14:03:37 +01:00
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_backup --src_path="/root/.ssh/id_${app}_ed25519"
|
|
|
|
ynh_backup --src_path="/root/.ssh/id_${app}_ed25519.pub"
|
|
|
|
# FIXME: uh do we really want to backup it all?
|
|
|
|
ynh_backup --src_path="/root/.ssh/config"
|
2022-03-13 17:45:45 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|