1. 程式人生 > >Delete expire backup data after seven day

Delete expire backup data after seven day

after pre else local xargs code archive delet files

#!/bin/bash
path=/usr/local
find ${path:-/tmp} -name ".tar.gz" -type f -mtime +7 | xargs rm -rf
retal=$?
if [ $retal - eq 0 ];then
echo " the file "
.tar.gz" deleted ."
else
echo " Not found archive files."
fi

Delete expire backup data after seven day