userjack6880 / Open-Report-Parser

A Perl based tool to parse DMARC reports from an IMAP mailbox or from the filesystem, and insert the information into a database. Derived from Techsneeze's dmarcts-report-parser
GNU General Public License v3.0
33 stars 8 forks source link

[Question]: How to set up cron? #27

Open robbrandt opened 6 months ago

robbrandt commented 6 months ago

So, I have the basic functions working by reading the report files from a directory. Now I want to automate reading the files and insert the data into the database. I have so far been executing ./report-parser.pl directly from the directory it is installed into.

When setting up cron, I assumed I would be able to use the fully qualified path to report-parser.pl. But when I execute it, it complains that it cannot find OAuth.pm. I note that OAuth.pm is actually located in the /lib subdirectory.

Do I need to installed OAuth via cpan or something so that it's findable from anywhere on the sytem?

RZN-FFEvo commented 5 months ago

add this to the top of your crontab PERL5LIB=/home/account/Open-Report-Parser/:/home/account/Open-Report-Parser/lib .... */5 * * * * perl /home/account/Open-Report-Parser/report-parser.pl -i -info >> /home/account/Open-Report-Parser/parser.log 2>&1