https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #6 from Eric Covener <[email protected]> ---
(In reply to max from comment #5)
> while true; do echo 123; done | rotatelogs -n2 1.%Y-%m-%d-%H_%M_%S.log 1k 
> Cannot use -n with % in filename
> 
> 
> if not append -n2, it will gen many log file
> 
> how to make a limit of number of file

you can't do both at the same time with rotatelogs directly.

With -n, you could add a hard link to each file with a simple -p script:

```
#!/bin/bash

CURFILE=$1
PREVFILE=$2

ln -f $CURFILE ${CURFILE}.log
```

Or without -n, use something like logrotated to purge old log files.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to