From 9a2da621b4666c8381e0bf97059c59fcc11017f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:36:32 +0200 Subject: [PATCH] Cron --- conf/cron | 2 ++ conf/cron_kanboard | 2 -- scripts/install | 4 ++-- scripts/restore | 1 + scripts/upgrade | 6 +++--- 5 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 conf/cron delete mode 100644 conf/cron_kanboard diff --git a/conf/cron b/conf/cron new file mode 100644 index 0000000..fcdcbf0 --- /dev/null +++ b/conf/cron @@ -0,0 +1,2 @@ +# Execute the daily cronjob at 8am +0 8 * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/cli cronjob > /dev/null diff --git a/conf/cron_kanboard b/conf/cron_kanboard deleted file mode 100644 index 9d2d511..0000000 --- a/conf/cron_kanboard +++ /dev/null @@ -1,2 +0,0 @@ -# Execute the daily cronjob at 8am -0 8 * * * __APP__ cd "__FINALPATH__" && PHP__PHPVERSION__ ./cli cronjob >/dev/null 2>&1 diff --git a/scripts/install b/scripts/install index bd2c9cc..d23958d 100644 --- a/scripts/install +++ b/scripts/install @@ -150,8 +150,8 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex #================================================= ynh_script_progression --message="Setuping a cron..." --weight=1 -ynh_add_config --template="../conf/cron_kanboard" --destination="/etc/cron.d/$app" - +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index d060594..80f53a3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -107,6 +107,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Restoring the cron file..." --weight=2 ynh_restore_file --origin_path="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7695f52..64d87f1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,10 +143,10 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex #================================================= # SETUP CRON #================================================= -ynh_script_progression --message="Setuping a cron..." - -ynh_add_config --template="../conf/cron_kanboard" --destination="/etc/cron.d/$app" +ynh_script_progression --message="Setuping a cron..." --weight=2 +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" #=================================================