Hi Bixuan, If the current time is 23:59:59 May 30 23:59:59 2015, we start to run the case and /var/log/*20150530* file is created. It has a delay before the program runs the following command added by you. rm -f /var/log/*`date '+%Y%m%d'`* > /dev/null 2>&1
If it is 2 seconds delay, the command will be "rm -f /var/log/*20150531*". The issue leads to the fact the previous log file can't removed. Thanks. Yuan On 2015/5/29 9:25, Cui Bixuan wrote: > On 2015/5/21 17:28, s00318865 wrote: > >> If the current time is 23:59:59, a problem would occur. It is good to use >> the following command. >> rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] >> Of course, it is better if you can find a way to use regular expressions to >> match it. > "If the current time is 23:59:59, a problem would occur." why? > The error occur when there are messages-20150406 file in /var/log/ and do > "logrotate" in 20150406(same day). > > Thanks, > Cui Bixuan > > > > > . > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list