diff --git a/backup_recommended_app_ynh/scripts/backup b/backup_recommended_app_ynh/scripts/backup index 706896f..19894f8 100644 --- a/backup_recommended_app_ynh/scripts/backup +++ b/backup_recommended_app_ynh/scripts/backup @@ -24,5 +24,4 @@ ynh_backup /etc/nginx/conf.d/$domain.d/$app.conf ynh_backup /etc/importantfile /etc/yoloswag # Backup db -root_pwd=$(sudo cat /etc/yunohost/mysql) -sudo su -c "mysqldump -u root -p$root_pwd --no-create-db $app > ${backup_dir}/db.sql" +ynh_mysql_dump_db $app > "${backup_dir}/db.sql" diff --git a/legacy_app_ynh/scripts/backup b/legacy_app_ynh/scripts/backup index 9b25a3a..9d0a803 100644 --- a/legacy_app_ynh/scripts/backup +++ b/legacy_app_ynh/scripts/backup @@ -24,5 +24,4 @@ ynh_backup /etc/nginx/conf.d/$domain.d/$app.conf "conf/nginx.conf" ynh_backup /etc/importantfile "${backup_dir}/importantfile" 1 # Backup db -root_pwd=$(sudo cat /etc/yunohost/mysql) -sudo su -c "mysqldump -u root -p$root_pwd --no-create-db $app > ${backup_dir}/db.sql" +ynh_mysql_dump_db $app > "${backup_dir}/db.sql"