LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-21-2017, 04:21 AM   #1
shankervenkat
LQ Newbie
 
Registered: Sep 2017
Posts: 3

Rep: Reputation: Disabled
logwatch run as a cronjob fails with the following error


Error in tempdir() using /var/cache/logwatch/logwatch.XXXXXXXX: Could not create directory /var/cache/logwatch/logwatch.pEfaDfD1: Permission denied at ../..//usr/share/logwatch/scripts/logwatch.pl line 800


/var/cache/logwatch folder permissions are set to 755.

if logwatch is run manually i generates a report and emails it.


logwatch running as part of the cronjob fails with the above message.

any help would be appreciated.
 
Old 09-24-2017, 08:08 PM   #2
vwtech
Member
 
Registered: Dec 2007
Distribution: Fedora, Oracle Linux & Centos
Posts: 197

Rep: Reputation: 26
Are you running it manually as the same user you have the crontab set for, sounds like the user attempting to run doesn't have permission to right to the log file.
 
Old 09-24-2017, 09:10 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,768

Rep: Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933
Welcome to LinuxQuestions.

It would help to know what distribution/version you are running as well as how you setup the cronjob.

May distributions configure logwatch to run via /etc/cron.daily.
 
Old 09-25-2017, 02:09 AM   #4
shankervenkat
LQ Newbie
 
Registered: Sep 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Question Error in tempdir() using /var/cache/logwatch/logwatch.XXXXXXXX

I had run it with the same user as has been configured in the cron ...viz. root

while the cron job fails ..the manual run is able to generate a report .


I have checked it is not a permissions issue for the user.
 
Old 09-25-2017, 02:33 AM   #5
shankervenkat
LQ Newbie
 
Registered: Sep 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Question logwatch run as a cronjob fails with the following error

Quote:
Originally Posted by vwtech View Post
Are you running it manually as the same user you have the crontab set for, sounds like the user attempting to run doesn't have permission to right to the log file.

I had run manually with the same user previeleges as that of the cron job i.e. user root.

I don't see it as a case of permissions.


some times i see "Error in tempdir() using /var/cache/logwatch/logwatch.XXXXXXXX: Could not create directory /var/cache/logwatch/logwatch.pEfaDfD1: Permission denied at ../..//usr/share/logwatch/scripts/logwatch.pl line 800"

at other times no log entry ...but end result is the same am not getting a logwatch report emailed to me ...we can safely ruleout any issues with postfix which my email server.

i had even ran the logwatch with perl debugger enabled in manual mode ...i don't see any anamolies ...or issues ...it was able to run successfully.


any other pointers, hints for troubleshooting are welcome
 
Old 09-26-2017, 04:41 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,365

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
Sounds like you need to run it from cron with a few judicious print statements around that point.
Possibly use this http://search.cpan.org/~mjd/Devel-Trace-0.12/Trace.pm or this http://search.cpan.org/~mob/Devel-Du...l/DumpTrace.pm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cronjob fails for ntpdate -u, yet runs from command line successfully JockVSJock Linux - Newbie 22 03-04-2016 10:14 AM
[SOLVED] Python Script Runs Perfectly on Bash but Fails at Cronjob browny redandy Linux - Newbie 4 07-29-2015 05:18 AM
Cronjob - logwatch failed, avc denied execstack Biosko Linux - Server 5 01-09-2013 09:13 AM
cronjob fails newtorhlinux Linux - Newbie 7 05-12-2012 12:43 PM
Does logwatch run automatically? How can I reset logwatch? abefroman Linux - Software 4 06-17-2009 02:17 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration