From 3942ea6105a91b42d0b55a466279645350ca3440 Mon Sep 17 00:00:00 2001 From: Sergei Solovev <31823239+SeAnSolovev@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:23:48 +0300 Subject: [PATCH] Fixed the intersection of rights settings, cron tasks and simultaneous execution cron.php (#9) --- deb.install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deb.install.sh b/deb.install.sh index 479e052..5e8de8b 100644 --- a/deb.install.sh +++ b/deb.install.sh @@ -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