Answers.Body: <p>If you want to sue the CURL method, the curl looks like this </p>
  
  <blockquote>
    <p><a href="https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&amp;pass=yourpass&amp;key=site_key&amp;job=mail_report&amp;instanceId=38" rel="nofollow noreferrer">https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&amp;pass=yourpass&amp;key=site_key&amp;job=mail_report&amp;instanceId=38</a></p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-30T10:47:15.067Z
Answers.LastActivityDate: 2019-04-30T10:47:15.067Z
Answers.UserDisplayName: Tony Horrocks
Answers.Body: <p>The solution is to exclude the iATS job from the "normal catch all" cronjob (so don't put it to run automatically daily)</p>
  
  <p>Then add a line on your cron to run it at 3 am</p>
  
  <pre><code>0 3 * * * www-data nice -n19 /usr/bin/drush -u 1 -r $drupal_root civicrm-api job.whatever-iats-name auth=0 -y
  </code></pre>
  
  <p>You will need to find what is the name of the iats api job, and put it in the line</p>
  
  <p>and voila, you should have it working now at 3 am</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-14T14:41:50.337Z
Answers.Text: Yes, and two caveats: 1. the recurring contribution job has a managed record, so in some versions it can re-enable itself. 2. iATS runs it own recurring contributions at 3am PST, so you likely don't want to choose that exact time, though it might be okay.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-04T06:03:48.093Z
Answers.Text: This is indeed the solution we're using, and it works. Just a note, though: individual jobs run directly from cron won't leave an entry in the Job Log. I decided to have the cron job call an intermediate shell script, which logs the job's result to the log.   
     
  Also, this solution is confusing to our civi admin, because the job is "disabled" on the "scheduled jobs" page, and yet it still runs (through the special 3am cron job I created). I've edited the title/description of the job on that page to make the situation clearer for the admin.   
     
  Thanks for the iATS-specific tips, @AlanDixon
Answers.UserDisplayName: Noah Miller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-30T10:46:24.213Z
Answers.Text: If you want to sue the CURL method, the curl looks like this "https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&pass=yourpass&key=site_key&job=mail_report&instanceId=38"'
Answers.UserDisplayName: Tony Horrocks
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-04T13:25:38.897Z
Answers.LastActivityDate: 2015-12-04T13:25:38.897Z
Answers.UserDisplayName: Xavier
Body: <p>I have a scheduled job, iATS Payments Recurring Contributions, set to run daily. Currently, the job fires off right after midnight every day. However, we need it to happen later -- say, around 3am.</p>
  
  <p>Cron runs <strong>drush civicrm-api job.execute</strong> twice an hour, triggering any scheduled jobs that are due to run.</p>
  
  <p>I know I can create a separate cron job at the desired time for this particular iATS scheduled job. However the iATS job may still get swept up by the catch-all <strong>civicrm-api job.execute</strong> and run at a different time, right?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-03T22:12:20.720Z
Comments.Text: You could disable the job and then add another cron job with drush where you replace job.execute by the entity and action of the specific job
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-03T23:46:43.007Z
Comments.Text: Thank. So the enabled/disabled status isn't respected when calling the job directly via the API?
Comments.UserDisplayName: Noah Miller
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-04T09:41:31.200Z
Comments.Text: I would assume so
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-09T19:44:39.927Z
Comments.Text: Is there a way to call a specific job via a URL?
Comments.UserDisplayName: Yossi
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-12T10:26:13.490Z
Comments.Text: If you have a new question, please ask it by clicking the [Ask Question](http://civicrm.stackexchange.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/low-quality-posts/5272)
Comments.UserDisplayName: William Mortada
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-13T12:01:56.597Z
Comments.Text: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/5272)
Comments.UserDisplayName: petednz - fuzion
Tags: <cron-job>
Title: Can I set a daily Scheduled Job to run at a specific time of day?
ThreadText: # Can I set a daily Scheduled Job to run at a specific time of day?
  
  (Asked by: username_0 on 2015-12-03)
  
  I have a scheduled job, iATS Payments Recurring Contributions, set to run daily. Currently, the job fires off right after midnight every day. However, we need it to happen later -- say, around 3am.
  
  Cron runs **drush civicrm-api job.execute** twice an hour, triggering any scheduled jobs that are due to run.
  
  I know I can create a separate cron job at the desired time for this particular iATS scheduled job. However the iATS job may still get swept up by the catch-all **civicrm-api job.execute** and run at a different time, right?
  
  **Tags:** cron-job
  
  > **Comments:**
  > **username_1**: You could disable the job and then add another cron job with drush where you replace job.execute by the entity and action of the specific job  
  > **username_0**: Thank. So the enabled/disabled status isn't respected when calling the job directly via the API?  
  > **username_1**: I would assume so  
  > **username_2**: Is there a way to call a specific job via a URL?  
  > **username_3**: If you have a new question, please ask it by clicking the [Ask Question](http://civicrm.stackexchange.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/low-quality-posts/5272)  
  > **username_4**: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/5272)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_6 on 2015-12-04. Score: 5 | Accepted answer
  
  The solution is to exclude the iATS job from the "normal catch all" cronjob (so don't put it to run automatically daily)
  
  Then add a line on your cron to run it at 3 am
  
  ```
  0 3 * * * www-data nice -n19 /usr/bin/drush -u 1 -r $drupal_root civicrm-api job.whatever-iats-name auth=0 -y
  
  ```
  
  You will need to find what is the name of the iats api job, and put it in the line
  
  and voila, you should have it working now at 3 am
  
  > **Comments:**
  > **username_7**: Yes, and two caveats: 1. the recurring contribution job has a managed record, so in some versions it can re-enable itself. 2. iATS runs it own recurring contributions at 3am PST, so you likely don't want to choose that exact time, though it might be okay.  
  > **username_0**: This is indeed the solution we're using, and it works. Just a note, though: individual jobs run directly from cron won't leave an entry in the Job Log. I decided to have the cron job call an intermediate shell script, which logs the job's result to the log.        Also, this solution is confusing to our civi admin, because the job is "disabled" on the "scheduled jobs" page, and yet it still runs (through the special 3am cron job I created). I've edited the title/description of the job on that page to make the situation clearer for the admin.        Thanks for the iATS-specific tips, @username_7  
  > **username_5**: If you want to sue the CURL method, the curl looks like this "https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&pass=yourpass&key=site_key&job=mail_report&instanceId=38"'  
  
  ---
  
  ### Answer by username_5 on 2019-04-30. Score: 0
  
  If you want to sue the CURL method, the curl looks like this
  
  > <https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&pass=yourpass&key=site_key&job=mail_report&instanceId=38>
  
  
  ---
  
  