need help in cron job execution for cpanel php script
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to write a cron job, I created a php file which will run every Tuesday and Sunday.
To test this I created a cron job which runs every 5 minutes. I have written a mail function inside it, but it looks like the cron job is not working as I have also updated my email id for the notification purpose.
Here is my cron job code and my php code:
3 * * * * php -q /home/jxxjordan/public_html/ospb2b/mycrons/depature.php
My php code:
$to = 'routemate.tech@gmail.com';
$subject = 'Marriage Proposal';
$message = 'Hi Jane, will you marry me?';
$from = 'depature@routemate.in';
// Sending email
if(mail($to, $subject, $message))
echo 'Your mail has been sent successfully.';
else
echo 'Unable to send email. Please try again.';
Is there anything wrong I am doing. I have got the cron job code from the in motion hosting forum.
cron php
add a comment |Â
up vote
0
down vote
favorite
I am trying to write a cron job, I created a php file which will run every Tuesday and Sunday.
To test this I created a cron job which runs every 5 minutes. I have written a mail function inside it, but it looks like the cron job is not working as I have also updated my email id for the notification purpose.
Here is my cron job code and my php code:
3 * * * * php -q /home/jxxjordan/public_html/ospb2b/mycrons/depature.php
My php code:
$to = 'routemate.tech@gmail.com';
$subject = 'Marriage Proposal';
$message = 'Hi Jane, will you marry me?';
$from = 'depature@routemate.in';
// Sending email
if(mail($to, $subject, $message))
echo 'Your mail has been sent successfully.';
else
echo 'Unable to send email. Please try again.';
Is there anything wrong I am doing. I have got the cron job code from the in motion hosting forum.
cron php
Do you have errors in the logfile of the mail program (Something like/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the3
by*/05
.
â Marco
Nov 27 '17 at 12:43
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to write a cron job, I created a php file which will run every Tuesday and Sunday.
To test this I created a cron job which runs every 5 minutes. I have written a mail function inside it, but it looks like the cron job is not working as I have also updated my email id for the notification purpose.
Here is my cron job code and my php code:
3 * * * * php -q /home/jxxjordan/public_html/ospb2b/mycrons/depature.php
My php code:
$to = 'routemate.tech@gmail.com';
$subject = 'Marriage Proposal';
$message = 'Hi Jane, will you marry me?';
$from = 'depature@routemate.in';
// Sending email
if(mail($to, $subject, $message))
echo 'Your mail has been sent successfully.';
else
echo 'Unable to send email. Please try again.';
Is there anything wrong I am doing. I have got the cron job code from the in motion hosting forum.
cron php
I am trying to write a cron job, I created a php file which will run every Tuesday and Sunday.
To test this I created a cron job which runs every 5 minutes. I have written a mail function inside it, but it looks like the cron job is not working as I have also updated my email id for the notification purpose.
Here is my cron job code and my php code:
3 * * * * php -q /home/jxxjordan/public_html/ospb2b/mycrons/depature.php
My php code:
$to = 'routemate.tech@gmail.com';
$subject = 'Marriage Proposal';
$message = 'Hi Jane, will you marry me?';
$from = 'depature@routemate.in';
// Sending email
if(mail($to, $subject, $message))
echo 'Your mail has been sent successfully.';
else
echo 'Unable to send email. Please try again.';
Is there anything wrong I am doing. I have got the cron job code from the in motion hosting forum.
cron php
edited Nov 27 '17 at 12:43
Marco
768616
768616
asked Nov 27 '17 at 12:29
Ravi Jordan
11
11
Do you have errors in the logfile of the mail program (Something like/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the3
by*/05
.
â Marco
Nov 27 '17 at 12:43
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04
add a comment |Â
Do you have errors in the logfile of the mail program (Something like/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the3
by*/05
.
â Marco
Nov 27 '17 at 12:43
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04
Do you have errors in the logfile of the mail program (Something like
/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the 3
by */05
.â Marco
Nov 27 '17 at 12:43
Do you have errors in the logfile of the mail program (Something like
/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the 3
by */05
.â Marco
Nov 27 '17 at 12:43
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407277%2fneed-help-in-cron-job-execution-for-cpanel-php-script%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Do you have errors in the logfile of the mail program (Something like
/var/log/mail.log
) or php? Also be aware that the script only runs at 3 minutes past the hour. For very 5 minutes you must replace the3
by*/05
.â Marco
Nov 27 '17 at 12:43
it started working. thanks sir @Marco
â Ravi Jordan
Nov 27 '17 at 12:57
Best to also just manually execute your departure.php script on the command line + verify all's well. Also append something like the following to your cronjob to capture output.... >> /var/log/departure.log 2>&1
â David Favor
Nov 27 '17 at 13:04