1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00
restic_ynh/scripts/backup

44 lines
1.5 KiB
Text
Raw Permalink Normal View History

#!/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
source /usr/share/yunohost/helpers
#=================================================
2024-05-25 09:34:34 +02:00
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
2024-05-25 09:34:34 +02:00
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
2024-05-25 09:34:34 +02:00
# BACKUP THE APP MAIN DIR
#=================================================
2024-05-25 09:34:34 +02:00
ynh_backup --src_path="$install_dir"
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
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)."