Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues with running multiple cron jobs
    primarykey
    data
    text
    <p>I am working on a project where I need to run 12 different PHP files, every night. 11 of these files are pulling data, each from a different external site and reformatting it into an XML file, for my purposes. The 12th file, combines the 11 XML files into a master XML file.</p> <p>I had originally had these combined into a single PHP file but, it was far too much and kept timing out. They work fine, separated as they are.</p> <p>I'm on a GoDaddy shared hosting plan and started setting up cron jobs to run these files every night. However, GoDaddy limits you to 10 cron jobs total. </p> <p>So, as an alternative, I placed a header redirect at the bottom of the first 10 files (obviously the last file doesn't need a redirect), to redirect to the next one and run it. This consolidates 11 cron jobs down to 1.</p> <pre><code>// On to the next header('Location: http://www.domain.com/secondFile.php'); </code></pre> <p>I did not realize, at the time, that header redirects only work in the browser, not in cron jobs. I'm getting a <strong>302 Moved Temporarily</strong> message.</p> <p>What other options do I have here? Are there redirects that <strong>will</strong> work in cron jobs?</p> <p>Any info provided is appreciated.</p> <hr> <hr> <p>Thanks to <strong>Barmar</strong>'s help, I've got it working now. Posting the format here for anyone else having the same issue, on GoDaddy hosting.</p> <p><strong>generatexml.sh</strong></p> <pre><code>#!/bin/sh /web/cgi-bin/php5 /home/content/u/s/e/username/html/firstFile.php /web/cgi-bin/php5 /home/content/u/s/e/username/html/secondFile.php /web/cgi-bin/php5 /home/content/u/s/e/username/html/thirdFile.php </code></pre> <p>etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload