while true | |
do | |
latest_folder=$(ls -td */ | head -n 1) | |
for folder in */; do | |
if [ $folder != $latest_folder ]; then | |
rm -rf $folder | |
fi | |
done | |
sleep 300 | |
done | |
while true | |
do | |
latest_folder=$(ls -td */ | head -n 1) | |
for folder in */; do | |
if [ $folder != $latest_folder ]; then | |
rm -rf $folder | |
fi | |
done | |
sleep 300 | |
done | |