blob: c83f22397462b8ffa15dc2a0b5d5014dc96a87d6 [file] [log] [blame]
#!/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