1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

Enable the Maintenance mode for the Friendica backup script

This is done to avoid errors with the database and be able to properly back it up. Else it will fail if you Friendica is an active instance and in the time that it takes to create a backup new entries will be added to the database. I tested it it works.
This commit is contained in:
Tio 2023-08-21 02:27:33 +02:00 committed by GitHub
parent dc7cd3eabe
commit 330c20bad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,6 +63,10 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Backup cron job # Backup cron job
ynh_backup --src_path="/etc/cron.d/$app" ynh_backup --src_path="/etc/cron.d/$app"
# Put Friendica in maintenance mode
ynh_print_info --message="Enabling the maintenance mode for Friendica"
/var/www/friendica/bin/console maintenance 1
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
@ -70,8 +74,13 @@ ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
# Disable the maintenance mode for Friendica
ynh_print_info --message="Disabling the maintenance mode for Friendica"
/var/www/friendica/bin/console maintenance 0
#================================================= #=================================================
# END OF SCRIPT # 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 --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."