Implement cron job for fixing website permissions

This commit is contained in:
Peca 2025-08-01 20:08:17 +02:00
commit c1f2a02fb8
2 changed files with 13 additions and 1 deletions

View file

@ -1894,7 +1894,9 @@ command="sudo $VESTA/bin/v-update-user-stats"
$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
command="sudo $VESTA/bin/v-update-sys-rrd" command="sudo $VESTA/bin/v-update-sys-rrd"
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
service cron restart command="sudo $VESTA/bin/v-fix-website-permissions-for-all-websites > /dev/null 2>&1"
$VESTA/bin/v-add-cron-job 'admin' '05' '03' '*' '*' '*' "$command"
systemctl restart cron.service
echo "== Building inititall rrd images" echo "== Building inititall rrd images"
$VESTA/bin/v-update-sys-rrd $VESTA/bin/v-update-sys-rrd

View file

@ -21,10 +21,20 @@ if [ ! -d "/usr/local/vesta/data/upgrades" ]; then
mkdir -p /usr/local/vesta/data/upgrades mkdir -p /usr/local/vesta/data/upgrades
fi fi
VESTA="/usr/local/vesta"
# show changelog after update # show changelog after update
echo "1" > /usr/local/vesta/data/upgrades/show_changelog echo "1" > /usr/local/vesta/data/upgrades/show_changelog
chmod a=rw /usr/local/vesta/data/upgrades/show_changelog chmod a=rw /usr/local/vesta/data/upgrades/show_changelog
# Fixing permissions for all websites
if ! grep -q "fix-website-permissions-for-all-websites" /usr/local/vesta/data/users/admin/cron.conf; then
echo "== Fixing permissions for all websites"
command="sudo $VESTA/bin/v-fix-website-permissions-for-all-websites > /dev/null 2>&1"
$VESTA/bin/v-add-cron-job 'admin' '05' '03' '*' '*' '*' "$command"
systemctl restart cron.service
fi
if ! grep -q "FILEMANAGER_KEY='FREEFM'" /usr/local/vesta/conf/vesta.conf; then if ! grep -q "FILEMANAGER_KEY='FREEFM'" /usr/local/vesta/conf/vesta.conf; then
echo "== Adding FileManager license to vesta.conf" echo "== Adding FileManager license to vesta.conf"
echo "FILEMANAGER_KEY='FREEFM'" >> /usr/local/vesta/conf/vesta.conf echo "FILEMANAGER_KEY='FREEFM'" >> /usr/local/vesta/conf/vesta.conf