2

I am using the famous logrotate with windows 7 and cygwin, I have the latest cygwin dll but somehow the app doesn't work for me, and the config file seems to be ok. Has anyone encountered this before? my config file is like so

nocreate
/cygdrive/c/log/*.log
{
    daily
    rotate 14
nocompress
nocopytruncate
}

and the console gives me an unexpected text error and also says that the specified directory cannot be found.

Edit:

 error: logrotate.conf:1 unexpected text
 error: logrotate.conf:2 lines must begin with a keyword or a filename (possibly in            double quotes)
 error: logrotate.conf:3 unexpected text
 error: logrotate.conf:4 unexpected text
 error: logrotate.conf:5 unexpected text
 error: logrotate.conf:6 unexpected text
 error: logrotate.conf:7 lines must begin with a keyword or a filename (possibly in   double quotes)
 error: logrotate.conf:8 lines must begin with a keyword or a filename (possibly in double quotes)
  error: stat of /cygdrive/C/log/*.log failed: No such file or directory

these are the errors I get from the console after running the app. Everything is ok with permissions.

splattne
  • 28,508
  • 20
  • 98
  • 148
Igor
  • 21
  • 2
  • It would be helpful if you would provide the exact text of the error messages. Which directory can it not find? The one with the logs or the one where it writes its status file? Does either of these directories not exist, or is it a permissions problem? Run logrotate in debug mode (-d). But first, track down and fix the unexpected text error. Are there any hidden control characters in the file? – ramruma Feb 20 '12 at 10:34

1 Answers1

1

Unexpected text probably means you have DOS-style line endings in logrotate.conf: try running

dos2unix logrotate.conf

Then there is this line:

error: stat of /cygdrive/C/log/*.log failed: No such file or directory
  1. Does that directory exist?
  2. Are there any *.log files in it?
  3. Is the * being expanded correctly?
  4. Is there a permissions problem caused by Windows 7 UAC not being handled by cygwin?

Try specifying, say, /tmp/testlogdir/testlog.log (and actually create that file!)

StackzOfZtuff
  • 1,842
  • 13
  • 21
ramruma
  • 2,740
  • 1
  • 15
  • 8