Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 1 | function beforeClean{ |
| 2 | echo -e "\n Before clean up disk usage: \n" |
| 3 | df -h |
| 4 | } |
| 5 | function cdTolog{ |
| 6 | cd /home/$1/OnosSystemTest/TestON/logs |
| 7 | } |
| 8 | function cleaning{ |
| 9 | if [ $? -eq 0 ] |
| 10 | then |
| 11 | echo "Checking if there are logs older than ${DAYS_OLD} days...." |
| 12 | for i in $(find . -mtime +${DAYS_OLD} -type d) |
| 13 | do |
| 14 | echo -e "DIRs older than $DAYS_OLD are: " |
| 15 | echo $i |
| 16 | rm -rf $i |
| 17 | done |
| 18 | fi |
| 19 | } |
| 20 | function afterClean{ |
| 21 | echo -e "\n After clean up disk usage:\n" |
| 22 | df -h |
| 23 | |
| 24 | } |