[thelist] help with logrotate...please

Hassan Schroeder hassan at webtuitive.com
Thu Apr 25 08:40:00 CDT 2002


Jake Aust wrote:

> It works on the command line, but not in the script.

Ah, that famous complaint above usually indicates a problem with
either path or permissions.

Make sure all paths are explicit ("/bin/mv" instead of "mv"); the
entity running the script may not have the same PATH as you do (or
any PATH at all, for that matter).

Make sure the entity running the script has appropriate permissions
on the relevant directory/file. You can determine that entity, and
whether it has write permission in your log directory, by inserting
a line in your script like

	/bin/touch /tmp/foo.test
	/bin/touch /home/virtual/lovejoyc/var/log/foo.test

If the script is run, the first line should create a file named
foo.test in /tmp, a directory that's globally writable. If it's
created, an `ls -l /tmp/foo.test' will show you "who" created it.

If the second line fails, you have a perms problem; that entity
doesn't have write permission in your log directory, and so can't
rename the log files.

HTH,
--
H*
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

    -- creating dynamic Web sites and applications since 1994 --



More information about the thelist mailing list