Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 3 | echo -e "\n Before clean up disk usage: \n" |
4 | df -h | ||||
Devin Lim | 397fa7c | 2018-04-13 16:25:01 -0700 | [diff] [blame] | 5 | cd /home/sdn/OnosSystemTest/TestON/logs |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 6 | |
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 7 | if [ $? -eq 0 ] |
8 | then | ||||
Devin Lim | d933324 | 2018-04-18 16:08:23 -0700 | [diff] [blame] | 9 | echo "Checking if there are logs older than ${DAYS_OLD} days...." |
10 | for i in $(find . -mtime +${DAYS_OLD} -type d) | ||||
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 11 | do |
12 | echo -e "DIRs older than $DAYS_OLD are: " | ||||
13 | echo $i | ||||
14 | rm -rf $i | ||||
15 | done | ||||
16 | fi | ||||
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 17 | |
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 18 | echo -e "\n After clean up disk usage:\n" |
Devin Lim | 32778a0 | 2018-04-09 16:20:59 -0700 | [diff] [blame] | 19 | df -h |