blob: c83f22397462b8ffa15dc2a0b5d5014dc96a87d6 [file] [log] [blame]
Devin Lim49200ec2018-01-19 16:17:41 -08001#!/bin/bash
2
Devin Limb00d26a2018-02-01 17:27:59 -08003echo -e "\n Before clean up disk usage: \n"
4df -h
Devin Lim49200ec2018-01-19 16:17:41 -08005
Devin Lim7d7cd992018-01-25 14:12:40 -08006cd /home/admin/OnosSystemTest/TestON/logs
Devin Lim49200ec2018-01-19 16:17:41 -08007
Devin Limb00d26a2018-02-01 17:27:59 -08008if [ $? -eq 0 ]
9then
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
17fi
Devin Lim49200ec2018-01-19 16:17:41 -080018
19cd /var/lib/jenkins/workspace/OnosProdCHOpost
20
21echo "Checking if there are jenkins-logs older than ${DAYS_OLD} days...."
22for i in $(find . -mtime +${DAYS_OLD})
23do
24echo -e "logs older than $DAYS_OLD are: "
25echo $i
26rm -rf $i
27done
28
Devin Limb00d26a2018-02-01 17:27:59 -080029echo -e "\n After clean up disk usage:\n"
Devin Lim32778a02018-04-09 16:20:59 -070030df -h