Fixed CRON task execution as root (#11)

This commit is contained in:
Sergei Solovev 2024-11-25 12:09:58 +03:00 committed by GitHub
parent 8e4d79ca84
commit aaf92ee50b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"