mardi 4 août 2015

Script running in crontab reporting database missing error when manually running it doesn't cause the issue

I have a script that I run manually every hour in my Laravel that's under this path:

/var/www/name/storage/scripts/getListOfClassesFromSubjects.pl

What I normally do is, I cd to /scripts/, and I manually run:

./getListOfClassesFromSubjects.pl

And the script works fine.

Today, I setup a crontab to automate this (obviously).

0,30 * * * * /var/www/name/storage/scripts/getListOfClassesFromSubjects.pl  >> /var/www/name/storage/logs/schedulizer.log 2>&1

Within my logs are this:

DBD::SQLite::db prepare failed: no such table: subject_urls at /var/www/loop/storage/scripts/getListOfClassesFromSubjects.pl line 56.

Which is an anomaly because when I run the script manually, it's fine.

This is my database's permissions:

-rw-r--r--  1 root     root     11750400 Aug  4 12:30 database.sqlite

So I'm thinking this is the issue with the rwx permissions, so I changed the DB to 755:

-rwxr-xr-x 1 root root 11750400 Aug  4 12:30 database.sqlite

Still the same issue

Aucun commentaire:

Enregistrer un commentaire