| #!/bin/bash |
| |
| echo -e "\n Before clean up disk usage: \n" |
| df -h |
| |
| cd /home/admin/OnosSystemTest/TestON/logs |
| |
| if [ $? -eq 0 ] |
| then |
| echo "Checking if there are logs older than ${{DAYS_OLD}} days...." |
| for i in $(find . -mtime +${{DAYS_OLD}} -type d) |
| do |
| echo -e "DIRs older than $DAYS_OLD are: " |
| echo $i |
| rm -rf $i |
| done |
| fi |
| |
| cd /var/lib/jenkins/workspace/OnosProdCHOpost |
| |
| echo "Checking if there are jenkins-logs older than ${DAYS_OLD} days...." |
| for i in $(find . -mtime +${DAYS_OLD}) |
| do |
| echo -e "logs older than $DAYS_OLD are: " |
| echo $i |
| rm -rf $i |
| done |
| |
| echo -e "\n After clean up disk usage:\n" |
| df -h |