public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Yuan Sun <sunyuan3@huawei.com>
To: Li Wang <liwang@redhat.com>
Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com
Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
Date: Mon, 1 Jun 2015 11:44:14 +0800	[thread overview]
Message-ID: <556BD50E.9070705@huawei.com> (raw)
In-Reply-To: <912409436.7035606.1433126786886.JavaMail.zimbra@redhat.com>

On 2015/6/1 10:46, Li Wang wrote:
> Hi,
>
> ----- Original Message -----
>> 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
> IMO, Bixuan's solution is pretty well. Even though the situation like that:
> "If the current time is 23:59:59 May 30 23:59:59 2015" and then will be
> "rm -f /var/log/*20150531*".
>
> It's means,
>
> The original file is: /var/log/messages-20150530.gz
> The removed file is:  /var/log/messages-20150531.gz
>
>> 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.
> But that's okay, the case wouldn't fail like:
> 'error: destination /var/log/messages-20150531.gz already exists,skipping
> rotation'.
>
> Because there will never be a name conflicts.
Yes. I understand. It is a small probability event.
Regards,
     Yuan
>
> Regards,
> Li Wang
>
>
>> 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
>>
> .
>


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-06-01  3:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 12:12 [LTP] [PATCH] commands/logrotate:run the case once again will failed Cui Bixuan
     [not found] ` <555D8E94.20605@huawei.com>
2015-05-21  9:28   ` s00318865
2015-05-29  1:25     ` Cui Bixuan
2015-05-30  7:01       ` Yuan Sun
2015-06-01  2:46         ` Li Wang
2015-06-01  3:44           ` Yuan Sun [this message]
2015-07-01 12:47 ` Cui Bixuan
2015-07-01 14:10   ` Alexey Kodanev
2015-07-02 12:06     ` Cui Bixuan
2015-07-02 14:22       ` Alexey Kodanev
2015-07-04  3:03         ` Cui Bixuan
2015-07-06 14:31           ` Alexey Kodanev
2015-07-07  9:13             ` [LTP] [PATCH v2] " Cui Bixuan
2015-07-09  5:59               ` Alexey Kodanev
2015-07-13  8:59                 ` Cui Bixuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556BD50E.9070705@huawei.com \
    --to=sunyuan3@huawei.com \
    --cc=liwang@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=peifeiyue@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox