Cron job to retrieve email
Posted: 07 Jan 2019, 14:57
I have checked and confirmed that my configuration for the mailbox is correct by executing the bug_report_mail.php on command prompt (I am using the Bitnami package running on Ubuntu on AWS).
But I am not able to get the cronjob to run properly.
The following is my statement in crontab:
This is the result:
Installed postfix and got the logs from /var/mail.
I have checked and from the bug_report_mail.php is in the stated folder. I am able to execute it on command prompt without any problems. Ran out of ideas. Anyone know how to fix this crontab? I've also tried to point to the PHP folder which is found in /opt/bitnami/php/bin.
But I am not able to get the cronjob to run properly.
The following is my statement in crontab:
Code: Select all
*/1* * * * * root /opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php
Code: Select all
From: root@-removed- (Cron Daemon)
To: root@i-removed-
Subject: Cron <root@-removed-> /opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
Message-Id: <-removed->
Date: Mon, 7 Jan 2019 14:47:01 +0000 (UTC)
/opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php: 1: /opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php: cannot open ?php: No such file
/opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php: 2: /opt/bitnami/apps/mantis/htdocs/plugins/EmailReporting/scripts/bug_report_mail.php: Syntax error: "(" unexpected
I have checked and from the bug_report_mail.php is in the stated folder. I am able to execute it on command prompt without any problems. Ran out of ideas. Anyone know how to fix this crontab? I've also tried to point to the PHP folder which is found in /opt/bitnami/php/bin.