Thursday, November 22, 2012
Saturday, November 17, 2012
Thursday, November 15, 2012
Tuesday, November 6, 2012
Monday, November 5, 2012
Saturday, October 27, 2012
Wednesday, July 4, 2012
logrotate: rotating logs in multiple directories
logrotate: rotating logs in multiple directories: I've got a server with almost one hundred web-sites. Each of the sites is in its own directory and runs its own logs ...
logrotate.conf:
include /usr/local/etc/logrotate.d
Only one hour later I understood that I can just write a path with multiple meta-characters to include ALL logs in just one line:
/usr/local/www/*/logs/*.log {
daily
rotate 60
compress
notifempty
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
More than one 'exec' action in 'find' command
More than one 'exec' action in 'find' command: When you run find command, you can pass the names of the found files to an arbitrary command using -exec option: find /tmp -mtime +3 -exe...
find /tmp -mtime +3 -exec rm {} \;find /tmp -mtime +3 -exec sh -c 'ls -ld "$0"; rm "$0"' {} \;
Saturday, May 19, 2012
Thursday, April 19, 2012
Friday, April 13, 2012
Monday, April 2, 2012
Thursday, March 29, 2012
Wednesday, February 8, 2012
Subscribe to:
Posts (Atom)