1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/syncserver-rs_ynh.git synced 2024-09-03 20:26:32 +02:00
syncserver-rs_ynh/scripts/backup
Mateusz 4d66d2babe
Fix installation (#10)
* Fix installation (#3)

* Fixed linter warnings

* Add python3-venv to deps.

* Auto-update README

* cleaning

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Add maintainer and tweak auto versioning. (#7)

* Fix backup, restore, upgrade and change_url (#6)

* Fix backup and restore.

* Don't 302 to docs on /

* Update nginx.conf

* Fix linter

* Fix more scripts.

* Anoter fix

* Increase verbosity.

* Update scripts.

* Use dedicated domain.

* Fixup restore.

* Only create dir if it does not exist.

* Update manifest.toml

* Update install

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Fix package id (#9)

* Fix package id

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
2023-10-25 10:17:56 +02:00

59 lines
No EOL
2 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# 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
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE DATABASE
#=================================================
ynh_print_info --message="Backing up the mysql database..."
### (However, things like MySQL dumps *do* take some time to run, though the
### copy of the generated dump to the archive still happens later)
ynh_mysql_dump_db --database="$db_name" > db.sql
ynh_mysql_dump_db --database="$db_name_tokenserver" > db_tokenserver.sql
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."