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

41 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
export ssh_user="$(ynh_app_setting_get $app ssh_user)"
export datadir="$(ynh_app_setting_get $app datadir)"
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
ynh_backup "$datadir/.ssh"
ynh_backup "$datadir/.nobackup"
ynh_backup "/etc/cron.d/$app"
ynh_print_info --message="Borg backup repo in $datadir/ won't be backup to avoid backup of backup loop issue."
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."