Fixed the intersection of rights settings, cron tasks and simultaneous execution cron.php (#9)

This commit is contained in:
Sergei Solovev 2024-11-24 23:23:48 +03:00 committed by GitHub
parent 6b15f23b6e
commit 3942ea6105
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,6 +249,11 @@ EOF
# Exporting a database
{ sudo cat /var/www/torrentpier/install/sql/mysql.sql | sudo mysql -u "$userSql" -p"$passSql" "$dbSql"; } 2>&1 | sudo tee -a "$logsInst" > /dev/null
# We set the rights to directories and files
sudo chown -R www-data:www-data /var/www/torrentpier 2>&1 | sudo tee -a "$logsInst" > /dev/null
sudo find /var/www/torrentpier -type f -exec chmod 644 {} \; 2>&1 | sudo tee -a "$logsInst" > /dev/null
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
else
@ -259,11 +264,6 @@ EOF
exit 1
fi
# We set the rights to directories and files
sudo chown -R www-data:www-data /var/www/torrentpier 2>&1 | sudo tee -a "$logsInst" > /dev/null
sudo find /var/www/torrentpier -type f -exec chmod 644 {} \; 2>&1 | sudo tee -a "$logsInst" > /dev/null
sudo find /var/www/torrentpier -type d -exec chmod 755 {} \; 2>&1 | sudo tee -a "$logsInst" > /dev/null
# Setting up nginx
if dpkg-query -W -f='${Status}' "nginx" 2>/dev/null | grep -q "install ok installed"; then
echo "===================================" 2>&1 | sudo tee -a "$logsInst" > /dev/null