[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron job mergelog failure



On Wed, Feb 08, 2012 at 10:57:54AM -0500, Tony Baldwin wrote:
> > > 0 1 * * * mergelog /var/log/apache2/access.log [...]
> > > Every day I get an e-mail telling me this failed.
> > 
> > > Now, I can go in and to this manually, 
> > > Why can't cron do it without my intervention?
> > 
> > 
> > What reason does the email give for the failure?
> > Chris
> 
> 
> mv: cannot stat `/var/log/apache2/MY.log': No such file or directory
> Clearly not merging logs and creating the MY.log file.
> I will try with the fully path and see happens tonight.

Your first cron job:
0 1 * * * mergelog /var/log/apache2/access.log /var/log/apache2/other_vhosts_access.log /var/log/apache2/my.log > MY.log

This does not run with /var/log/apache2/ as $PWD, so MY.log won't be
created in that directory.  Try being explicit about the path to MY.log,
e.g. /var/log/apache2/MY.log

noah

Attachment: signature.asc
Description: Digital signature


Reply to: