From 85a408bea5dd447d9a13a794581cf5f7e5202bf6 Mon Sep 17 00:00:00 2001 From: anmol Date: Wed, 31 Oct 2018 20:13:26 +0530 Subject: [PATCH] cron job backup and restore --- scripts/backup | 6 ++++++ scripts/restore | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/backup b/scripts/backup index 10f2b20..5cceb39 100755 --- a/scripts/backup +++ b/scripts/backup @@ -55,3 +55,9 @@ ynh_backup "/etc/php5/fpm/pool.d/$app.conf" #================================================= ynh_mysql_dump_db "$db_name" > db.sql + +#================================================= +# BACKUP A CRON FILE +#================================================= + +ynh_backup "/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 8388eca..c773425 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,13 +76,6 @@ ynh_system_user_create $app # Restore permissions on app files chown -R $app: $final_path -# Set up cron -ynh_replace_string "YNH_WWW_PATH" "$final_path" ../conf/cron -ynh_replace_string "__USER__" "$app" ../conf/cron -ynh_replace_string "__DOMAIN__" "$domain" ../conf/cron -ynh_replace_string "__PATH__" "$path_url" ../conf/cron -sudo cp -f ../conf/cron /etc/cron.d/$app - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -98,6 +91,12 @@ ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" # Define and install dependencies ynh_install_app_dependencies php7.0-curl php7.0-gd php7.0-cli php7.0-mysql php-xml php7.0-mbstring +#================================================= +# RESTORE THE CRON FILE +#================================================= + +ynh_restore_file "/etc/cron.d/$app" + #================================================= # GENERIC FINALIZATION #=================================================