File size: 210 Bytes
a2af9e6
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash  

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