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

56 lines
1.7 KiB
Text
Raw Normal View History

2015-11-18 17:22:55 +01:00
#!/bin/bash
2017-09-11 08:29:58 +02:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
2021-01-11 23:46:48 +01:00
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
2017-09-11 08:29:58 +02:00
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
2015-11-18 17:22:55 +01:00
2023-02-07 22:27:23 +01:00
ynh_backup --src_path="$install_dir"
2015-11-18 17:22:55 +01:00
#=================================================
# BACKUP THE APP DATA
#=================================================
2021-09-16 11:39:20 +02:00
ynh_backup --src_path="$data_path" --is_big
2017-09-11 08:29:58 +02:00
#=================================================
2021-01-11 23:46:48 +01:00
# BACKUP THE NGINX CONFIGURATION
2017-09-11 08:29:58 +02:00
#=================================================
2015-11-18 17:22:55 +01:00
2021-01-11 23:46:48 +01:00
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
2015-11-18 17:22:55 +01:00
2017-09-11 08:29:58 +02:00
#=================================================
2021-01-11 23:46:48 +01:00
# BACKUP LOGROTATE
2017-09-11 08:29:58 +02:00
#=================================================
2021-01-11 23:46:48 +01:00
ynh_backup --src_path="/etc/logrotate.d/$app"
2017-09-11 08:29:58 +02:00
#=================================================
# BACKUP SYSTEMD
2017-09-11 08:29:58 +02:00
#=================================================
2021-01-11 23:46:48 +01:00
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE DATABASE
2021-01-11 23:46:48 +01:00
#=================================================
2022-06-29 12:09:28 +02:00
ynh_print_info --message="Backing up the database..."
2021-01-11 23:46:48 +01:00
ynh_psql_dump_db --database="$db_name" > db.sql
2021-01-11 23:46:48 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."