Cobub Razor
Cobub Toaster
Other Links
Cobub Razor
Cobub Toaster
Other Links
This document is valid for Version 0.7 of Cobub Razor.
This document is valid for Version 0.7 of Cobub Razor. Check out the release note
In Cobub Razor, user must setup the scheduled tasks on server so that data can automatically be processed from original database to data warehouse. All the mobile analytics reports are built from data warehouse. To automatically run the Cobub Razor scheduled task, user can setup scripts which executed by task scheduler.
The instructions below show users how to schedule task Under Linux/Unix systems, and also for Windows. There are five tasks to do scheduled for reports:
Important Tips to Schedule the Task:
The cron is time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs(commands or shell scripts) to run periodically at certain time or dates.
Firstly, create five scripts files and put them into one folder (take /var/www/cron as example):
And please make sure the .sh file has execute rights. If no execute rights, please run
sudo chown +x *.sh
razor_hourly_archive.sh file
#!/bin/bash php /usr/share/nginx/razor/index.php archive archiveHourly
razor_weekly_archive.sh file
#!/bin/bash php /usr/share/nginx/razor/index.php archive archiveWeekly
razor_monthly_archive.sh file
#!/bin/bash php /usr/share/nginx/razo/index.php archive archiveMonthly
razor_laterdata_archive.sh file
#!/bin/bash php /usr/share/nginx/razor/index.php archive archiveLaterData
razor_daily_archive.sh file
#!/bin/bash php /usr/share/nginx/razorindex.php archive archiveUsingLog
The Crontab requires php-cli or php-cgi installed, so please confirm it firstly. Then, user can use SSH or Putty to access to server to config crontab, and input the below command in shell:
crontab -e
and then add the following lines:
# System will execute scriptonce every hour and at the fifth minute of the hour. 5 * * * * /var/www/cron/razor_hourly_archive.sh
# System will execute script once at 1:00 every day. 0 1 * * * /var/www/cron/razor_daily_archive.sh
# System will execute scriptonce at 0:30 every Sunday. 30 0 * * 0 /var/www/cron/razor_weekly_archive.sh
# System will execute scriptonceat 0:30 in the first day of every month. 30 0 1 * * /var/www/cron/razor_monthly_archive.sh
# System will execute scriptonce at 1:30 every day. 30 1 * * * /var/www/cron/razor_laterdata_archive.sh
Save and exit, then restart cron to enable the schedule
/etc/init.d/cron restart
To open the task sc heduler on Windows (XP, 7, 2003/2008 Server), click All Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks. Click ‘Add Scheduled Task’ and name the task e.g. “Razor Hourly Archive”. Schedule the task as following.
If php.exe has b een added to PATH of System Environment Variable, please use php in the command. Otherwise, please give the detail directory of php.exe, for example, D:\xampp\php\php.exe. For the below instructions, “D:\xampp\htdocs\razor\index.php” is the example directory of Cobub Razor on web server.
1. Hourly Archive Task Open “Razor Hourly Archive” task, in the “Task” tab, input following comand in “Run”:
php "D:\xampp\htdocs\razor\web\index.php" archive archiveHourly
Every 10 minutes from each hour, this hourly task should be run. This is configured in “Schedule” tab:
2. Weekly Archive Task
Run
php "D:\xampp\htdocs\razor\web\index.php" archive archiveWeekly
Every week’s 12:20 will start the weekly task:
3. Monthly Archive Task
Run:
php "D:\xampp\htdocs\razor\web\index.php" archive archiveMonthly
Every month’s 01:20 will start the weekly task:
4. LaterData Archive Task
php "D:\xampp\htdocs\razor\web\index.php" archive archiveLaterData
5. Daily Archive Task
php "c:\xampp\htdocs\razor\web\index.php" archive archiveUsingLog
If user can do cron on server, w e highly recommend running a cron or scheduled task on it. However, on some shared hosting, or on special server configurations, users are not allowed to run a cron or schedule task. User can find some online web cron service, which is simple URL that the hosts will automatically visit at a scheduled time. If user want use a web cron, please input the following URL in their hosting interface:
http://server_url/index.php?/archive/archiveHourly
http://server_url/index.php?/archive/archiveWeekly
http://server_url/index.php?/archive/archiveMonthly
http://server_url/index.php?/archive/archiveLaterData
http://server_url/index.php?/archive/archiveUsingLog
* server_url is the root url of user’s installed Cobub Razor.
In order to make more functions in Cobub Razor available, user can visit: