Compare commits

..

12 Commits

Author SHA1 Message Date
Daniel Sosnowski
2a23ffcce5 added small fixes 2025-12-04 15:44:06 +01:00
Daniel Sosnowski
70b0663e75 Added a brace expansion 2025-12-04 15:22:27 +01:00
Daniel Sosnowski
e8b69d1291 newer version 2025-12-04 15:18:54 +01:00
Daniel Sosnowski
1bc2bdd610 Fixed 2025-12-04 15:01:57 +01:00
Daniel Sosnowski
ce58bf8bbe fixing 2025-12-04 15:00:53 +01:00
Daniel Sosnowski
1f02319909 added and if instruction 2025-12-04 14:58:15 +01:00
Daniel Sosnowski
3c5f93678d . 2025-12-04 14:39:21 +01:00
Daniel Sosnowski
b0f67d0933 changed nothing 2025-12-04 14:18:22 +01:00
Daniel Sosnowski
92522071ae Added a function and some variable 2025-12-03 11:29:01 +01:00
Daniel Sosnowski
1fee221c06 changed the name of the disk 2025-12-03 10:34:40 +01:00
Daniel Sosnowski
892593ebe2 . 2025-12-03 10:19:56 +01:00
Daniel Sosnowski
c9cf5009c1 added new loop 2025-12-03 10:02:20 +01:00

View File

@@ -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
@@ -18,13 +18,14 @@ then
echo -e "Rozpoczynam czyszczenie cache...\n" echo -e "Rozpoczynam czyszczenie cache...\n"
for subscription in "${subscriptionList[@]}" for subscription in "${subscriptionList[@]}"
do
for path in "$subscription/httpdocs/shopsystem/application/cache/boxes" "$subscription/httpdocs/shopsystem/application/cache/smarty_compiled"
do do
if [[ -d "$subscription/httpdocs/shopsystem/application/cache/boxes" ]] if [[ -d $path ]]
then then
cd "$subscription/httpdocs/shopsystem/application/cache/boxes" cd "$path"
fi echo -e "Czyszczę cache w subskrybcji ${subscription##./}...\n"
echo -e "Czyszczę cache w subskrybcji $subscription...\n"
ls -1 > "/tmp/dirList.txt" ls -1 > "/tmp/dirList.txt"
readarray -t dirList < /tmp/dirList.txt readarray -t dirList < /tmp/dirList.txt
for dir in "${dirList[@]}" for dir in "${dirList[@]}"
@@ -37,9 +38,10 @@ then
cd .. cd ..
fi fi
done done
fi
cd "$vhostDir" cd "$vhostDir"
done done
done
fi fi
if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]] if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]]