We make sure that we add "php Code/Daemon/Run.php" in /etc/crontab only when we need to (and avoid duplicates)

This commit is contained in:
Papa Dragon 2023-02-28 22:03:25 +01:00
parent eed550223c
commit 347f57fa37

View file

@ -395,7 +395,10 @@ function configure_daily_update {
function configure_cron_daily {
print_info "configuring cron..."
# every 10 min for Run.php
echo "*/10 * * * * www-data cd $install_path; php Code/Daemon/Run.php Cron >> /dev/null 2>&1" >> /etc/crontab
if [[ ! -z $(grep "/var/www/$install_folder; php Code/Daemon/Run.php" /etc/crontab) ]]
then
echo "*/10 * * * * www-data cd $install_path; php Code/Daemon/Run.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30 to update repository core and addon
echo "#!/bin/sh" > /var/www/$cron_job