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 | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 5 | |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 6 | cd /home/admin/OnosSystemTest/TestON/logs |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 7 | |
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 8 | if [ $? -eq 0 ] |
| 9 | then |
| 10 | echo "Checking if there are logs older than ${{DAYS_OLD}} days...." |
| 11 | for i in $(find . -mtime +${{DAYS_OLD}} -type d) |
| 12 | do |
| 13 | echo -e "DIRs older than $DAYS_OLD are: " |
| 14 | echo $i |
| 15 | rm -rf $i |
| 16 | done |
| 17 | fi |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 18 | |
| 19 | cd /var/lib/jenkins/workspace/OnosProdCHOpost |
| 20 | |
| 21 | echo "Checking if there are jenkins-logs older than ${DAYS_OLD} days...." |
| 22 | for i in $(find . -mtime +${DAYS_OLD}) |
| 23 | do |
| 24 | echo -e "logs older than $DAYS_OLD are: " |
| 25 | echo $i |
| 26 | rm -rf $i |
| 27 | done |
| 28 | |
Devin Lim | b00d26a | 2018-02-01 17:27:59 -0800 | [diff] [blame] | 29 | echo -e "\n After clean up disk usage:\n" |
Devin Lim | 32778a0 | 2018-04-09 16:20:59 -0700 | [diff] [blame] | 30 | df -h |