forked from volumio/volumio-plugins
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
volspotconnect2- update readme - reduce cache size
- Loading branch information
Showing
4 changed files
with
20 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,20 @@ | ||
# !/bin/bash | ||
# this script removes last file in volspotconnect2 cache when cachesize limit is reached | ||
ucachesize=120 #cache size Mo | ||
#let ucachesize=$cachesize/2 | ||
ucachesize=64 #cache size Mo | ||
cfolder=/tmp/files #folder where cache files are stored | ||
#c2folder=/dev/shm/volspotconnect2/cache/c2/files | ||
|
||
|
||
cd $cfolder | ||
checkedsize=$(du -sm $cfolder) | ||
size=$(echo $checkedsize | cut -d' ' -f1) | ||
|
||
while [ $size -gt $ucachesize ] | ||
while [ $size -gt $ucachesize ] # condition to execute the cache purge | ||
do | ||
echo 'cache need to purged' | ||
echo 'cache needs to be purged' | ||
ls -tr1 | head -n 1 | xargs rm -Rf | ||
echo purged | ||
checkedsize=$(du -sm $cfolder) | ||
size=$(echo $checkedsize | cut -d' ' -f1) | ||
echo 'cache uses' $size 'Mo' | ||
done | ||
echo 'cache not full, nothing do' | ||
#cd $c2folder | ||
#checkedsize=$(du -sm $c2folder) | ||
#size=$(echo $checkedsize | cut -d' ' -f1) | ||
|
||
#while [ $size -gt $ucachesize ] | ||
# do | ||
# echo 'cache need to purged' | ||
# ls -tr1 | head -n 1 | xargs rm -Rf | ||
# echo purged | ||
# checkedsize=$(du -sm $cfolder) | ||
# size=$(echo $checkedsize | cut -d' ' -f1) | ||
# echo 'cache c2 uses' $size 'Mo' | ||
# done | ||
#echo 'cache C2 not full, nothing to do' | ||
|
Binary file not shown.