Compare commits
12 Commits
3b5e115675
...
2a23ffcce5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a23ffcce5 | ||
|
|
70b0663e75 | ||
|
|
e8b69d1291 | ||
|
|
1bc2bdd610 | ||
|
|
ce58bf8bbe | ||
|
|
1f02319909 | ||
|
|
3c5f93678d | ||
|
|
b0f67d0933 | ||
|
|
92522071ae | ||
|
|
1fee221c06 | ||
|
|
892593ebe2 | ||
|
|
c9cf5009c1 |
@@ -3,7 +3,7 @@
|
|||||||
declare -i diskUsage
|
declare -i diskUsage
|
||||||
vhostDir="/var/www/vhosts"
|
vhostDir="/var/www/vhosts"
|
||||||
|
|
||||||
diskUsage=$(df -h | grep /dev/mapper/Fabricsy--vg-root | awk '{print $5}' | cut -d% -f1)
|
diskUsage=$(df -h / | grep /dev | awk '{print $5}' | cut -d% -f1)
|
||||||
if [[ $diskUsage -ge 50 ]]
|
if [[ $diskUsage -ge 50 ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
@@ -19,27 +19,29 @@ then
|
|||||||
|
|
||||||
for subscription in "${subscriptionList[@]}"
|
for subscription in "${subscriptionList[@]}"
|
||||||
do
|
do
|
||||||
|
for path in "$subscription/httpdocs/shopsystem/application/cache/boxes" "$subscription/httpdocs/shopsystem/application/cache/smarty_compiled"
|
||||||
if [[ -d "$subscription/httpdocs/shopsystem/application/cache/boxes" ]]
|
|
||||||
then
|
|
||||||
cd "$subscription/httpdocs/shopsystem/application/cache/boxes"
|
|
||||||
fi
|
|
||||||
echo -e "Czyszczę cache w subskrybcji $subscription...\n"
|
|
||||||
ls -1 > "/tmp/dirList.txt"
|
|
||||||
readarray -t dirList < /tmp/dirList.txt
|
|
||||||
for dir in "${dirList[@]}"
|
|
||||||
do
|
do
|
||||||
if [[ -d "$dir" ]]
|
|
||||||
then
|
|
||||||
echo -e "Czyszczenie $dir...\n"
|
|
||||||
cd "$dir"
|
|
||||||
ls -1
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
cd "$vhostDir"
|
|
||||||
done
|
|
||||||
|
|
||||||
|
if [[ -d $path ]]
|
||||||
|
then
|
||||||
|
cd "$path"
|
||||||
|
echo -e "Czyszczę cache w subskrybcji ${subscription##./}...\n"
|
||||||
|
ls -1 > "/tmp/dirList.txt"
|
||||||
|
readarray -t dirList < /tmp/dirList.txt
|
||||||
|
for dir in "${dirList[@]}"
|
||||||
|
do
|
||||||
|
if [[ -d "$dir" ]]
|
||||||
|
then
|
||||||
|
echo -e "Czyszczenie $dir...\n"
|
||||||
|
cd "$dir"
|
||||||
|
ls -1
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
cd "$vhostDir"
|
||||||
|
done
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]]
|
if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]]
|
||||||
|
|||||||
Reference in New Issue
Block a user