Author Topic: Cron Job  (Read 6801 times)

Jon Watkins

  • Posts: 17
    • View Profile
Cron Job
« on: November 02, 2016, 02:37:22 pm »
Ok I am pulling my hair out here. The daily mail will NOT run. Contacted my host and the say wget is ok. I have looked at solutions using fetch and so forth and it will just not run. Can someone look at this code and see what I may have messed up? My host won't offer any advice on the coding. Here is what I have minus the password obviously.

0 0 * * * /usr/bin/wget -O /dev/null -T 0 http://online-ministries.org/news-alerts/dailymail.php?pw=Password 1> /dev/null 2> /dev/null

I have set the chromod to 755 on everything. All runs well sending mails. I can do the dailymail and it runs fine and sends the email to me. Just wont run automatically. What is this thick brain not getting?

Jon

Jon Watkins

  • Posts: 17
    • View Profile
Re: Cron Job
« Reply #1 on: November 03, 2016, 03:55:22 am »
Can!t seem to find an edit post feature. I wanted to add that I can run the dailymail Manually and it sends out the report just fine.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • http://listmailpro.com
Re: Cron Job
« Reply #2 on: November 06, 2016, 04:54:14 am »
Hi Jon,

The part at the end, "1> /dev/null 2> /dev/null", redirects all output to null, so you could remove that and enable the email feature if your host has it. It may be automatic. Any output when the cron task runs should be emailed to you. You might see things such as "File not found" (no wget available), "Access denied" (bad password), etc.

If you want to run the task more frequently to test it you'll want to make sure you have no followups on lists with real users to avoid sending them email, then you could change the timing to * * * * * to run every minute, or */5 * * * * to run every 5 minutes, temporarily. You'd need to disable the 24-hr restriction on the Dailymail page in LMP as well.

There are other ways to test wget and cron such as with custom scripts that is more involved. For such hands-on support please visit https://listmailpro.com/support

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Jon Watkins

  • Posts: 17
    • View Profile
Re: Cron Job
« Reply #3 on: November 07, 2016, 01:48:03 am »
Took off the end like you suggested Dean and it ran. Now I get a email with this -   /bin/sh: 0: command not found.

this is the code I have in there. 0 0 * * * /usr/bin/wget -O /dev/null -T 0 http://online-ministries.org/news-alerts/dailymail.php?pw=password

Jon

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • http://listmailpro.com
Re: Cron Job
« Reply #4 on: November 07, 2016, 04:16:17 am »
Hi Jon,

It looks like you have entered the timing part (0 0 * * *, which means daily at midnight) in the area where just the command should go. You may have to separate the timing from the command (/usr/bin/wget ...) and enter the timing manually using other inputs depending on your web hosting control panel.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Jon Watkins

  • Posts: 17
    • View Profile
Re: Cron Job
« Reply #5 on: November 09, 2016, 03:46:11 am »
Thanks Dean, it is now working. Problem 2.

I only have 115 subscribers right now. When I send a mail it stops at 50 and says to check configuration. The settings are at the default 1000. I changed to 500 and it still pauses and I have to hit resume 2 times to send them all.  What do I look for to fix this? It was working OK until a couple weeks ago. Did they restrict something on the server at my Host?

Jon