mirror of
https://github.com/YunoHost-Apps/unattended_upgrades_ynh.git
synced 2024-10-01 13:35:00 +02:00
62 lines
1.9 KiB
Bash
62 lines
1.9 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source ../settings/scripts/_common.sh
|
|
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_script_progression --message="Load settings"
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
#=================================================
|
|
# SPECIFIC BACKUP
|
|
#=================================================
|
|
# BACKUP UNATTENDED-UPGRADES CONFIG
|
|
#=================================================
|
|
ynh_script_progression --message="Backup unattended-upgrades config"
|
|
|
|
ynh_backup "/etc/apt/apt.conf.d/50unattended-upgrades"
|
|
# Backup also the backup of the config file
|
|
ynh_backup "/etc/apt/50unattended-upgrades.backup"
|
|
|
|
#=================================================
|
|
# BACKUP APT PERIODIC
|
|
#=================================================
|
|
ynh_script_progression --message="Backup APT periodic"
|
|
|
|
ynh_backup "/etc/apt/apt.conf.d/02periodic"
|
|
|
|
#=================================================
|
|
# BACKUP APTICRON CONFIG
|
|
#=================================================
|
|
ynh_script_progression --message="Backup Apticron config"
|
|
|
|
ynh_backup "/etc/apticron/apticron.conf"
|
|
|
|
#=================================================
|
|
# BACKUP THE CRON FILE
|
|
#=================================================
|
|
ynh_script_progression --message="Backup cron file"
|
|
|
|
ynh_backup "/etc/cron.d/apticron"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Backup completed" --last
|