From aaf92ee50b93ae05b9ae54999605fb19dde9fce8 Mon Sep 17 00:00:00 2001 From: Sergei Solovev <31823239+SeAnSolovev@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:09:58 +0300 Subject: [PATCH] Fixed CRON task execution as root (#11) --- deb.install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.install.sh b/deb.install.sh index 3c5e3b8..0758d4c 100644 --- a/deb.install.sh +++ b/deb.install.sh @@ -255,7 +255,7 @@ EOF sudo find /var/www/torrentpier -type d -exec chmod 755 {} \; 2>&1 | sudo tee -a "$logsInst" > /dev/null # Setting the CRON task - { (sudo crontab -l; echo "* * * * * php /var/www/torrentpier/cron.php") | sudo crontab -; } 2>&1 | sudo tee -a "$logsInst" > /dev/null + { (sudo crontab -l; echo "* * * * * sudo -u www-data php /var/www/torrentpier/cron.php") | sudo crontab -; } 2>&1 | sudo tee -a "$logsInst" > /dev/null else echo "===================================" 2>&1 | sudo tee -a "$logsInst" > /dev/null echo "TorrentPier is already installed on the system. The installation cannot continue." | tee -a "$logsInst"