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.prestashop_1.7.8.6.com/module/cybersourceofficial/paymentReporth
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
- Open a Linux terminal.
- Entercrontab-eto enter editor mode. For example:root@PrestashopQA4:/etc# crontab -e
- 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.prestahop.cybsplugin.com/mps1760/module/mybank/paymentReport
- EnterCtrl + Xto close the editor.
- Enter thecrontab -lcommand to check the scheduled cron job. For example:
The scheduled cron job should appear on the screen. For example:root@PrestashopQA4:/etc# crontab -l15 * * * * curl https://www.dev.prestahop.cybsplugin.com/mps1760/module/mybank/paymentReport
Setting Up Cron Scheduler for Mac
- Open a Mac terminal.
- Entercrontab-eto enter editor mode.C02X63PRJG5J:~ $crontab -e
- 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.prestahop.cybsplugin.com/mps1786/module/cybersourceofficial/paymentReport
- EnterEsc + : + w + qto close the editor. The editor closes and displays this message:crontab: installing new crontab
- Enter thecrontab -lcommand to check the scheduled cron job.C02X63PRJG5J:~ $crontab -lThe scheduled cron job should display on the screen. For example:45 * * * * curl https://www.qa.prestahop.cybsplugin.com/mps1786/module/cybersourceofficial/paymentReport
Setting Up Task Scheduler for Windows
- Open the Task Scheduler app and clickCreate Task.The Create Task pane displays.
- Select theGeneraltab and enter a name for the task in theNamefield.
- Select theTriggerstab and clickNew.The New Trigger pane displays.
- Make the desired timing selections for the task in the New Trigger pane and clickOK.
- Select theActionstab in the Create Task pane and clickNew.The New Action pane displays.
- Select and enter this information in the New Action pane and clickOK.
- Action drop-down menu:choose Start a program.
- Program/script field:enter thecurlcommand.
- Add arguments (optional):enter the reporting URL.
- ClickOKin the Create Task pane to create the task. The new task displays in the Task Scheduler Summary.