Hi Guys,
I'm currently working on a simple bash script that will check the current size of files inside directory and if it's larger than specific value .. the script should remove the files until it reached to specific value .. but it seems it's not working "The script always going outside the loop which is weird for me "
Any helpCode:#!/bin/bash CURR_DIR_SIZE=`du -sk /opt/test/ | cut -f1` MAX_SIZE=81920 #echo $CURR_DIR_SIZE while [[ $CURR_DIR_SIZE -gt $MAX_SIZE ]] do echo $CURR_DIR_SIZE FILE=`ls -1tra test/ | head -1` rm -rf $FILE CURR_DIR_SIZE=`du -sk /opt/test/ | cut -f1` done exit 0
Thanks in advance



Adv Reply




Bookmarks