Delete Files Older Than x Days on Linux - How-To Geek
find /path/to/files* -mtime +5 -exec rm {} \;
[root@www ~]# cat /root/mk-remove-old.sh
# MK 7.6.2011
# --------------------------------------------------------------------------
bash -c 'date;find /home/dataxKopr/Data_for_HLS/* -mtime +14 -exec rm -v {} \;;date' >> /var/log/mk-removed.log
bash -c 'date;find /home/dataxKopr/Data_for_KOPR/* -mtime +14 -exec rm -v {} \;;date' >> /var/log/mk-removed.log
bash -c 'date;find /home/dataxTMS/from_TMS/* -mtime +14 -exec rm -v {} \;;date' >> /var/log/mk-removed.log
bash -c 'date;find /home/dataxTMS/to_TMS/* -mtime +14 -exec rm -v {} \;;date' >> /var/log/mk-removed.log
bash -c 'date;find /home/httpd/www.hlsczech.cz-80/html/store/* -mtime +14 -exec rm -v {} \;;date' >> /var/log/mk-removed.log
echo "---------------------------------------------" >> /var/log/mk-removed.log
# --------------------------------------------------------------------------
Žádné komentáře:
Okomentovat