Posterous theme by Cory Watilo

to find magic

Как удалить все логи, которые старше трех дней? В *NIX это можно сделать скриптом в одну строку: [cc lang="bash"] # cat ./clean_logs.sh #!/bin/sh DIR=/usr/local/www/data/www.example.com/cron /usr/bin/find $DIR -maxdepth 3 -mindepth 1 -type f -name "*.log" -ctime +3 -print0 | xargs -r -0 /bin/rm -f [/cc] Собственно, так файлики удалятся из текущей папки и из подпапок.
| Viewed
times
Filed under: