Scheduling Report Generation

Schedulers on a Linux, Mac, or Windows system are used to set up how often a specified report is generated. Schedulers for Linux and Mac systems are set up using a Cron Tab. The scheduler for a Windows system is set up using the Windows Task Scheduler app.
When setting up a schedule for generating a specific report, use this format:
  • Format:
    <
    shop domain name
    >/module/cybersourceofficial/paymentReport
  • Example:
    http://www.opencart_1.7.8.6.com/module/cybersourceofficial/paymentReport

Cron Tab Syntax for Mac and Linux Systems

When setting up the reporting schedule on a Linux or Mac system, you use
crontab
commands that determine how often and when the report is generated.
The syntax is:
* * * * * [command]
The asterisk (*) represents each of these timing parameters:
  • Minute (0-59)
  • Hour (0-23)
  • Day of Month (1-31)
  • Month (1-12)
  • Day of week (0-6), (0-Sunday)
For example, these timing parameters indicate how often a specified report is generated:
  • * * * * * [command]
    : Runs every minute of every day of every week of every month.
  • 0 * * * * [command]
    : Runs every hour of every day of every week of every month.
  • 30 2 * * * [command]
    : Runs at 2:30 a.m. every day of every week of every month.
  • 0 0 2 * * [command]
    : Runs once a month every month on the second day of the month.
  • 0 * * * 1 [command]
    : Runs every Monday at every hour.
  • 0,10,20 * * * * [command]
    : Runs on 0, 10, 20 minute of every hour of every day of every week of every month.
  • 0 5-10 * * * *[command]
    : Runs every hour between 5 and 10 a.m.
  • @reboot [command]
    : Runs every time after the server reboots.
  • */5 * * * * [command]
    : Runs every 5 minutes of every day.

Setting Up Cron Scheduler for Linux

  1. Open a Linux terminal.
  2. Enter
    crontab-e
    to enter editor mode. For example:
            
    root@OpencartQA4:/etc# crontab -e
  3. Enter the command to set the timing for the cron job. For example, this command sets the cron job to run every 15th minute of every hour, every day, every week, and every month:
            
    15 * * * * curl https://www.dev.opencart.cybsplugin.com/mps1760/module/mybank/paymentReport
  4. Enter
    Ctrl + X
    to close the editor.
  5. Enter the
    crontab -l
    command to check the scheduled cron job. For example:
            
    root@OpencartQA4:/etc# crontab -l
    The scheduled cron job should appear on the screen. For example:
            
    15 * * * * curl https://www.dev.opencart.cybsplugin.com/mps1760/modjava.io.PrintWriter@21ffb2c7 ule/mybank/paymentReport

Setting Up Cron Scheduler for Mac

  1. Open a Mac terminal.
  2. Enter
    crontab-e
    to enter editor mode.
            
    C02X63PRJG5J:~ $crontab -e
  3. Enter the command to set the timing for the cron job. For example, this command sets the cron job to run every 45th minute of every hour, every day, every week, and every month:
            
    45 * * * * curl https://www.qa.opencart.cybsplugin.com/mps1786/module/cybersourceofficial/paymentReport
  4. Enter
    Esc + : + w + q
    to close the editor. The editor closes and displays this message:
            
    crontab: installing new crontab
  5. Enter the
    crontab -l
    command to check the scheduled cron job.
            
    C02X63PRJG5J:~ $crontab -l
    The scheduled cron job should display on the screen. For example:
            
    45 * * * * curl https://www.qa.opencart.cybsplugin.com/mps1786/module/cybersourceofficial/paymentReport

Setting Up Task Scheduler for Windows

  1. Open the Task Scheduler app and click
    Create Task
    .
    The Create Task pane displays.
  2. Select the
    General
    tab and enter a name for the task in the
    Name
    field.
  3. Select the
    Triggers
    tab and click
    New
    .
    The New Trigger pane displays.
  4. Make the desired timing selections for the task in the New Trigger pane and click
    OK
    .
  5. Select the
    Actions
    tab in the Create Task pane and click
    New
    .
    The New Action pane displays.
  6. Select and enter this information in the New Action pane and click
    OK
    .
    • Action drop-down menu:
      choose Start a program.
    • Program/script field:
      enter the
      curl
      command.
    • Add arguments (optional):
      enter the reporting URL.
  7. Click
    OK
    in the Create Task pane to create the task. The new task displays in the Task Scheduler Summary.