in reply to Log rotaion for the files which are existed in the absolute paths from the config files

G'day perladdict,

It would have helped if you'd shown (at least a sample of) what you're actually getting for $abspath. I'll have to guess.

When $path is

/opt/xxx/domains/test0813/dev/platform/log/*.log

You get a value of $abspath that looks like

/opt/xxx/domains/test0813/dev/platform/log/*.logwhatever.log

But what you really want is

/opt/xxx/domains/test0813/dev/platform/log/whatever.log

You'll need to chop of the wildcard part (i.e. *.log, in this instance) before concatenating the filename.

-- Ken

  • Comment on Re: Log rotaion for the files which are existed in the absolute paths from the config files
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Log rotaion for the files which are existed in the absolute paths from the config files
by perladdict (Chaplain) on Mar 27, 2014 at 21:26 UTC
    Hi Kcott,
    For testing perpose i have created a config file as like below and created directory structure as like in below config and created few sample log files and text files in appropriate paths.I am getting the absolute path as like below
    mesh0123 /tmp/rajp/test123/logs/ 185KB 3 mesh0456 /tmp/rajp/test456/ 255KB 2 mesh0789 /tmp/rajp/test789-/logs/ 240KB 2 mesh0001 /tmp/rajp/link/platform/log/ 185KB 4 /tmp/rajp/test123/logs/a.log /tmp/rajp/test456/logs/b.log /tmp/rajp/test789/logs/c.log /tmp/rajp/xxxxx/logs/d.log /tmp/rajp/yyyyy/logs/z.log /tmp/rajp/zzzzz/ab.txt /tmp/rajp/test/ac.log /tmp/rajp/test456/ad.txt /tmp/rajp/test789/logs/S.txt /tmp/rajp/test789/logs/T.txt /tmp/rajp//xxxx/log/a.log /tmp/rajp/xxxxx/platform/log/b.log /tmp/rajp/xxxxx/platform/log/c.log /tmp/rajp/yyyyyy/platform/log/d.log