Skip to content

Commit 4cbc753

Browse files
ioannidesalexKristan Kenney
authored andcommitted
Change cron script permissions, clean Hestia PHP sessions (hestiacp#341)
1 parent b869822 commit 4cbc753

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

install/hst-install-debian.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,8 @@ done
12261226
# Cleanup php session files not changed in the last 7 days (60*24*7 minutes)
12271227
echo '#!/bin/sh' > /etc/cron.daily/php-session-cleanup
12281228
echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
1229-
chmod 644 /etc/cron.daily/php-session-cleanup
1229+
echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
1230+
chmod 755 /etc/cron.daily/php-session-cleanup
12301231

12311232

12321233
#----------------------------------------------------------#

install/hst-install-ubuntu.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,8 @@ done
11891189
# Cleanup php session files not changed in the last 7 days (60*24*7 minutes)
11901190
echo '#!/bin/sh' > /etc/cron.daily/php-session-cleanup
11911191
echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
1192-
chmod 644 /etc/cron.daily/php-session-cleanup
1192+
echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
1193+
chmod 755 /etc/cron.daily/php-session-cleanup
11931194

11941195

11951196
#----------------------------------------------------------#

install/upgrade/0.10.0-190430.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# define vars
3+
# Define vars
44
HESTIA="/usr/local/hestia"
55
HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
66
hestiacp="$HESTIA/install/deb"
@@ -22,10 +22,10 @@ if [ -z "$release_branch_check" ]; then
2222
echo "RELEASE_BRANCH='develop'" >> $HESTIA/conf/hestia.conf
2323
fi
2424

25-
# load hestia.conf
25+
# Load hestia.conf
2626
source $HESTIA/conf/hestia.conf
2727

28-
# load hestia main functions
28+
# Load hestia main functions
2929
source /usr/local/hestia/func/main.sh
3030

3131
# Initialize backup directory
@@ -88,7 +88,7 @@ if [ -f /etc/nginx/nginx.conf ]; then
8888
cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
8989
fi
9090

91-
# Generating dhparam
91+
# Generate dhparam
9292
if [ ! -e /etc/ssl/dhparam.pem ]; then
9393
echo "(*) Enabling HTTPS Strict Transport Security (HSTS) support..."
9494
mv /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
@@ -254,9 +254,12 @@ for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
254254
done
255255

256256
# Cleanup php session files not changed in the last 7 days (60*24*7 minutes)
257-
echo '#!/bin/sh' > /etc/cron.daily/php-session-cleanup
258-
echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
259-
chmod 644 /etc/cron.daily/php-session-cleanup
257+
if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
258+
echo '#!/bin/sh' > /etc/cron.daily/php-session-cleanup
259+
echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
260+
echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
261+
fi
262+
chmod 755 /etc/cron.daily/php-session-cleanup
260263

261264
# Fix empty pool error message for MultiPHP
262265
php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)

0 commit comments

Comments
 (0)