diff --git a/conf/cron_kanboard b/conf/cron_kanboard new file mode 100644 index 0000000..04a9686 --- /dev/null +++ b/conf/cron_kanboard @@ -0,0 +1,2 @@ +# Execute the daily cronjob at 8am +0 8 * * * cd "__FINALPATH__" && ./cli cronjob >/dev/null 2>&1 \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index b346135..4ddf7a7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -57,6 +57,12 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +#================================================= +# BACKUP A CRON FILE +#================================================= + +ynh_backup --src_path="/etc/cron.d/$app" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 183b30f..1f90531 100644 --- a/scripts/install +++ b/scripts/install @@ -49,8 +49,6 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS -#================================================= - #================================================= # CREATE A MYSQL DATABASE #================================================ @@ -146,6 +144,14 @@ ynh_script_progression --message="Configuring Fail2Ban..." --weight=10 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 +#================================================= +# SETUP CRON +#================================================= +ynh_script_progression --message="Setuping a cron..." + +cp ../conf/cron_kandboard /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file="/etc/cron.d/$app" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index c631c86..80922e1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -71,6 +71,14 @@ ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=7 ynh_remove_fail2ban_config +#================================================= +# REMOVE THE CRON FILE +#================================================= +ynh_script_progression --message="Removing the cron file..." --weight=2 + +# Remove a cron file +ynh_secure_remove --file="/etc/cron.d/$app" + #================================================= # REMOVE DEDICATED USER #================================================= diff --git a/scripts/restore b/scripts/restore index d9bbc3c..56c4399 100644 --- a/scripts/restore +++ b/scripts/restore @@ -99,6 +99,13 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban +#================================================= +# RESTORE THE CRON FILE +#================================================= +ynh_script_progression --message="Restoring the cron file..." --weight=2 + +ynh_restore_file --origin_path="/etc/cron.d/$app" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5bc3e79..9618866 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -171,6 +171,14 @@ ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 +#================================================= +# SETUP CRON +#================================================= +ynh_script_progression --message="Setuping a cron..." + +cp ../conf/cron_kandboard /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file="/etc/cron.d/$app" + #================================================= # SETUP SSOWAT #=================================================