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

55 lines
1.8 KiB
Text
Raw Normal View History

2022-02-28 23:39:48 +01:00
#!/bin/bash
2022-03-02 04:02:38 +01:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2022-02-28 23:39:48 +01:00
2022-03-02 04:02:38 +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
2022-02-28 23:39:48 +01:00
2022-03-02 04:02:38 +01:00
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
2024-01-10 12:50:39 +01:00
ynh_backup --src_path="$install_dir"
2022-03-02 04:02:38 +01:00
#=================================================
2024-03-22 15:16:28 +01:00
# BACKUP THE SYSTEM CONFIGURATION
2022-03-02 04:02:38 +01:00
#=================================================
2024-03-22 15:16:28 +01:00
# Backup the nginx configuration
2022-03-02 04:02:38 +01:00
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
2024-03-22 15:16:28 +01:00
# Backup the systemd service unit
ynh_backup --src_path="/etc/systemd/system/$app.service"
# Backup the logrotate configuration
ynh_backup --src_path="/etc/logrotate.d/$app"
2022-03-02 04:02:38 +01:00
#=================================================
2024-03-22 15:16:28 +01:00
# BACKUP VARIOUS FILES
2022-03-02 04:02:38 +01:00
#=================================================
2024-03-22 15:16:28 +01:00
ynh_backup --src_path="/var/log/$app/"
2022-03-02 04:02:38 +01:00
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
2022-03-02 19:38:40 +01:00
ynh_psql_dump_db --database="${db_name}" > db.sql
ynh_psql_dump_db --database="${db_name}olap" > dbolap.sql
ynh_psql_dump_db --database="${db_name}tenant" > dbtenant.sql
2022-03-02 04:02:38 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."