bstascavage / plexReport

Scripts to generate a weekly email of new additions to Plex
67 stars 17 forks source link

Log File Not Found #61

Closed Kazz3r24 closed 8 years ago

Kazz3r24 commented 8 years ago

I saw that this was a closed issue; however it looks like myself and another person are running into the issue. This script will be AMAZING when I get it working, I've been waiting years for something like this. I am receiving the same error message after fresh install. Running Ubuntu 14.04 LTS.

~/plexReport$ plexreport -t Log file not found. Exiting...

I tried an update using the script a few minutes ago and it completed successfully. I can also "cat" the log file and there's definitely content in there, just seems like the script isn't finding the log in /var/log/

bstascavage commented 8 years ago

How did you fix this? Because the inital_setup.sh script creates the log file.

/bin/echo "Creating /var/log/plexReport.log" /usr/bin/touch /var/log/plexReport.log

Kazz3r24 commented 8 years ago

Yes, I read though the script and saw that’s how the script was being created. I did read the log file as well and it was definitely there, it seemed like it wasn’t being read or accessed for some reason.

I wasn’t sure if it was a permissions issue or not, so after I re-ran initial_setup.sh and double checked that the log file was still there and it did indeed have all the relevant data in it. I then changed the permissions on it chmod –R 755 /etc/plexReport/ (not sure if that actually changed anything).

Test emails worked 100% the whole time, yet when I would manually run the script to see if I could get it working - it wasn’t until I changed permissions on it that it would actually run and send off the email.

I’m not 100% sure if I’ve fixed it or not; however it is now successfully sending emails to myself, along with other recipients in the config.yaml file.

My crontab is set to send off emails at midnight on Sundays with a detail summary, so we’ll see if cron is working (it hasn’t been so far) I’ve manually sent off most of the emails thus far.

As of right now my crontab looks like this.

0 0 * * 0 /usr/local/sbin/plexreport –d –n

Running this command via command line works like a charm so I figure having it set in cron like that should work, no?

I also realize that I’ve sent you a lot more than what you asked for, but I like to send as much detail as possible.

Thank you for your response!

Kevin Kazienko kevinkazienko@gmail.com (705)984-9247

On 15-10-22 03:02 PM, Brian wrote:

How did you fix this? Because the |inital_setup.sh| script creates the log file.

/bin/echo "Creating /var/log/plexReport.log" /usr/bin/touch /var/log/plexReport.log

— Reply to this email directly or view it on GitHub https://github.com/bstascavage/plexReport/issues/61#issuecomment-150323783.

bstascavage commented 8 years ago

No, thank you for the details. So it sounds like the script did not have permissions to access the log file, huh? Were you running this as a non-root user? I believe I did all my testing as root, so that could be the issue.

And yeah, that crontab looks fine. If it ran by hand it should run fine via cron. Though, with the '-n' flag, you won't be notifying your friends about it, FYI.