On Tue, Apr 06, 2010 at 04:18:22PM +0200, frantisek holop wrote: | > Come on man .. 'can of worms' ?! It's not even a real challenge. | | you left off the year...
So you think it's my problem ? I showed two possible options, both very workable (and easily extensible to add something simple as a year). Yet... | i'd rather not bloat my 3 line scripts with lookup tables | and recursive date(1) calls, i prefer them easy and short. ...you choose to complain about the options I provided. | here's the full picture of the current situation: | | on 1. april i get this file through monthly.local: | | logfile-2010-04.log.gz | | containing all _march_ entries (plus some april if it creeped in). | | i have 2 choices: | 1. do the rename dance backwards one month | 2. let the job actually run sometimes before midnight, last day of the month. or 3. use "recursive date(1) calls" (how, exactly, are those recursive ? you've got a weird definition of recursion) gzip < ${LOG} > logfile-$(date -r $(($(date +%s) - 86400)) +%Y-%m).gz There, I've put in the year for you, beacuse you couldn't think of that yourself somehow. I don't really care much how you do it, but that is not recursion nor very bloated, imo. You come to this list to ask for something. It's not possible and you are given alternative solutions. All you can do is complain about them. Why ? | regarding the "forward casualties" of log rotation, yes it's the same. | while chronologically i still prefer the other way, i.e. have older | entries in the newer log file (and not newer entries in older logfiles), | but the main issue is, that i end up with the wrong file name. It isn't an issue - the solution has been presented to you. A few lines up, I've spelled it out for you (one possible solution, that is). You just choose to publicly dismiss it because you don't like it. Why ? Paul 'WEiRD' de Weerd PS: Don't bother replying to the 'whys' in this e-mail, they're meant for self-reflection. -- >++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+ +++++++++++>-]<.>++[<------------>-]<+.--------------.[-] http://www.weirdnet.nl/