Good afternoon, i would like to know what is the best way to have a log rotation with sec.
I tried this : in my crontab : #Log rotation for correlation 59 23 * * * /usr/local/CORRELATION/rotateLogs.sh in 'rotateLogs.sh' : #!/bin/ksh ############################ /bin/mv /usr/local/CORRELATION/logs/sec.log /usr/local/CORRELATION/logs/sec.log.`date +%F` /bin/touch /usr/local/CORRELATION/logs/sec.log /bin/kill -SIGUSR2 `cat /usr/local/CORRELATION/sec.pid` exit 0 in my log directory : [r...@tqwdgc01x /usr/local/CORRELATION/logs]# ls -l total 3135216 -rw-r--r-- 1 root root 670446 Jan 26 10:46 dump.log -rw-r--r-- 1 root root 0 Mar 18 23:59 sec.log -rw-r--r-- 1 root root 130506115 Feb 11 11:07 sec.log.2010-02-10 -rw-r--r-- 1 root root 112122200 Feb 12 10:49 sec.log.2010-02-11 -rw-r--r-- 1 root root 105520789 Feb 13 09:29 sec.log.2010-02-12 -rw-r--r-- 1 root root 307281617 Feb 15 11:34 sec.log.2010-02-13 -rw-r--r-- 1 root root 0 Feb 13 23:59 sec.log.2010-02-14 -rw-r--r-- 1 root root 128697038 Feb 16 14:46 sec.log.2010-02-15 -rw-r--r-- 1 root root 128723028 Feb 17 13:53 sec.log.2010-02-16 -rw-r--r-- 1 root root 90556168 Feb 18 09:02 sec.log.2010-02-17 -rw-r--r-- 1 root root 120542397 Feb 19 10:37 sec.log.2010-02-18 -rw-r--r-- 1 root root 341591518 Feb 22 12:01 sec.log.2010-02-19 -rw-r--r-- 1 root root 0 Feb 19 23:59 sec.log.2010-02-20 -rw-r--r-- 1 root root 0 Feb 20 23:59 sec.log.2010-02-21 -rw-r--r-- 1 root root 111071320 Feb 23 11:30 sec.log.2010-02-22 -rw-r--r-- 1 root root 132737580 Feb 24 15:07 sec.log.2010-02-23 -rw-r--r-- 1 root root 86991916 Feb 25 08:53 sec.log.2010-02-24 -rw-r--r-- 1 root root 122497795 Feb 26 10:39 sec.log.2010-02-25 -rw-r--r-- 1 root root 639773639 Mar 3 23:35 sec.log.2010-02-26 -rw-r--r-- 1 root root 0 Feb 26 23:59 sec.log.2010-02-27 -rw-r--r-- 1 root root 0 Feb 27 23:59 sec.log.2010-02-28 Sometimes it works, but sometimes the rotation doesn't work, sec keeps on writing into the previous log file and the new log file stays empty. Best regards, Antonin. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Simple-evcorr-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
