aboutsummaryrefslogtreecommitdiff
path: root/scripts/backup
diff options
context:
space:
mode:
authorThomas <51749973+Thovi98@users.noreply.github.com>2025-08-21 10:42:04 +0200
committerThomas <51749973+Thovi98@users.noreply.github.com>2025-08-21 10:42:04 +0200
commite827fbe4a89c0dcd51308457e5f00a9fc5dcc18b (patch)
tree2f1bc893b809539efdd81568897cafcf183a7131 /scripts/backup
parent1d2bff59e07dba330f3ee73b9ac08835c9a0640b (diff)
downloadmastodon_ynh-e827fbe4a89c0dcd51308457e5f00a9fc5dcc18b.tar.gz
mastodon_ynh-e827fbe4a89c0dcd51308457e5f00a9fc5dcc18b.tar.bz2
mastodon_ynh-e827fbe4a89c0dcd51308457e5f00a9fc5dcc18b.zip
convert to helpers v2.1 and try to upgrade to latest version
Diffstat (limited to 'scripts/backup')
-rw-r--r--scripts/backup31
1 files changed, 11 insertions, 20 deletions
diff --git a/scripts/backup b/scripts/backup
index de1ba98..e9b18e8 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -1,31 +1,22 @@
#!/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..."
+ynh_print_info "Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
-ynh_backup --src_path="$install_dir"
+ynh_backup "$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
-ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
+ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
@@ -33,31 +24,31 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP LOGROTATE
#=================================================
-ynh_backup --src_path="/etc/logrotate.d/$app"
+ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
-ynh_backup --src_path="/etc/systemd/system/$app-web.service"
-ynh_backup --src_path="/etc/systemd/system/$app-sidekiq.service"
-ynh_backup --src_path="/etc/systemd/system/$app-streaming.service"
+ynh_backup "/etc/systemd/system/$app-web.service"
+ynh_backup "/etc/systemd/system/$app-sidekiq.service"
+ynh_backup "/etc/systemd/system/$app-streaming.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
-ynh_backup --src_path="/etc/cron.d/$app"
+ynh_backup "/etc/cron.d/$app"
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
-ynh_print_info --message="Backing up the PostgreSQL database..."
+ynh_print_info "Backing up the PostgreSQL database..."
-ynh_psql_dump_db --database="$db_name" > db.sql
+ynh_psql_dump_db > db.sql
#=================================================
# END OF SCRIPT
#=================================================
-ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
+ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."