-1

guys. im trying to add to logrotate files from a some directory. it should be either *.txt files or *_log files. wtat's the right syntax for this:

/var/www/html/groupware/horde_logs/[*.txt|*_log]{
missingok
notifempty
sharedscripts
size=5129k
delaycompress
postrotate
endscript
}

~

or it should be:

..{*.txt|*_log} or ..(*.txt|*_log)?
user16081-JoeT
  • 1,948
  • 11
  • 18
Shirker
  • 579
  • 1
  • 5
  • 18

1 Answers1

1

It would be *{.txt,_log} (note the comma, not the pipe). However, after a quick look at the source to logrotate (Ubuntu Saucy) I see the flag GLOB_BRACE to enable this GNU extension isn't present. Thus, you have to do something like

/var/www/html/groupware/horde_logs/*.txt /var/www/html/groupware/horde_logs/*_log {
  ...
}

instead.

Mark Wagner
  • 18,019
  • 2
  • 32
  • 47
  • Thank you. I'll take note of this. i was thinking to use [^.#]* but figured out, that it will rotate over all files. so i'd rather use `/var/www/html/groupware/horde_logs/*.txt /var/www/html/groupware/horde_logs/*_log` – Shirker Oct 19 '13 at 14:17