Hello,is it possible to fetch mails per cron without being logged in as an agent?The cron job itself runs fine, but it seems it only fetches mail if i'm logged inRegards,InvaderZim
Q: is it possible to fetch mails per cron without being logged in as an agent?A: Yes.You are going to want to provide your Admin panel -> Settings -> Emails settings, cron job settings, and version of osTicket.
great to hear :)this is my cron-job:# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * php /var/www/vhosts/user/support.domain.eu/api/cron.phpthese are my E-Mail settings:and osticket Version is osTicket (v1.9.12)
what version of PHP are you running? You may want to provide the path to PHP instead of just calling php if you have multiple versions installed.You should uncheck Fetch on auto-cron.
My PHP Version is 5.6.17. i just added the whole path /usr/bin/php and unchecked fetch on auto-cron but stil only works if logged in
I would change# 0,5,10,15,20,25,30,35,40,45,50,55 * * * *to*/5 * * * *are you getting any PHP errors in the logs?
Sorry, I know it's totally off topic, but that username tho! @[deleted] is a great choice! Love that episode with the waffle song!
Ok now back 2 topic...
Maybe totally stupid question, but do you see the cron is being executed e.g. via /var/log/messages or similar log file (can vary by linux distro and settings made).
Also as which user do you run the cron job (permissions?) and what happens when you delete and re-add the cron job - sounds maybe stupid but I remember that really worked once here years ago
Cheers,
Michael
"Must do what the taco man tells me!"
/offtopic i love Zim. Too bad they canceled himits not an cron or php error - at least i think so.i also can run it without problems on console manually. no errors in any log.It really works if logged in: All mails are converted to tickets the time i activate fire up /usr/bin/php /var/www/vhosts/user/support.domain.eu/api/cron.php on console (or wait till the cronjob kicks in)
Then I currently have only the idea to make a little shell script which contains that command/usr/bin/php /var/www/vhosts/user/support.domain.eu/api/cron.phpand try letting this shell script then run via cron. If that does not work too, I'm out on ideas why it's not working.
aaah sorry if this was ambiguous, my english is not that good.The problem is not that the cronjob/console command doesn't work, it runs fine. Problem is, it only creates tickets from mails if i'm logged in as an agent. Its definitively the cronjob/command which creates the ticket when i'm logged in
But that would mean it does not work correctly since with the cronjob it shall create the tickets even when you're not logged in.What you describe currently is the behavior for auto-cron which creates tickets only when an agent is logged in / actively using osTicket.
jupp, exactlydebug shows that only the cron is active. The last time auto-cron was running was yesterday at 20I even tried to call it with wget and api-key. It showed the same behavior.For me it seems the call works basically with all 4 possibilities (manually, shell-script, remote, cron)
Does it make a difference if you run the cron job as root or as any other user?Guessing around here, but can't explain why its not working :/Mabye @[deleted] has another idea though? PS: "BURRRRRRITOS!" ;)
nope, makes no difference
Shooting in the dark here... Do you have more than one version of PHP installed on the server?
Yes, there is PHP 5.5 and 5.6, but only 5.6 is activatedphp -v:PHP 5.6.17-pl0-gentoo (cli) (built: Feb 9 2016 18)phpinfo:PHP Version
5.6.17-pl0-gentoo
try changing the path to the absolute path to php5.6(which might be /usr/bin/php5 or /usr/bin/php56 but you can look and see)
That really worked, many thanks!
WOOT! Sometimes when more than one version of PHP is installed, the executable pointed to is the old version so you have to specify the newer version.