用户工具

站点工具


差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
en:razor:auto-archiving [2015/03/18 10:35]
cobub [2.1 Prepare script files]
en:razor:auto-archiving [2017/07/14 11:18] (当前版本)
行 1: 行 1:
 +~~Title:​Cobub Razor Scheduled Task - Mobile Apps Marketing Platform of Open Source - Mobile Analytics & Mobile Push Notification Solutions - Cobub Mobile Developer Center~~
 +{{description>​Cobub Razor is an Open Source Mobile Analytics. In Cobub Razor, user must setup the scheduled tasks on server so that data can automatically be processed from original database to data warehouse.}}
 +{{keywords>​Cobub Razor,open source mobile analytics,​mobile analytics,​mobile app analytics, scheduled task}}
 +
 ====== Cobub Razor Scheduled Task ====== ====== Cobub Razor Scheduled Task ======
 This document is valid for Version 0.7 of Cobub Razor. Check out the [[en:​razor:​release-note|release note]] This document is valid for Version 0.7 of Cobub Razor. Check out the [[en:​razor:​release-note|release note]]
行 34: 行 38:
  
 <​code>​sudo chown +x *.sh</​code>​ <​code>​sudo chown +x *.sh</​code>​
 +
 +**razor_hourly_archive.sh file**
 +<​code>#​!/​bin/​bash
 +php /​usr/​share/​nginx/​razor/​index.php archive archiveHourly</​code>​
 +
 +
 +**razor_weekly_archive.sh file**
 +<​code>#​!/​bin/​bash
 +php /​usr/​share/​nginx/​razor/​index.php archive archiveWeekly</​code>​
 +
 +
 +**razor_monthly_archive.sh file**
 +<​code>#​!/​bin/​bash
 +php /​usr/​share/​nginx/​razo/​index.php archive archiveMonthly</​code>​
 +
 +
 +**razor_laterdata_archive.sh file**
 +<​code>#​!/​bin/​bash
 +php /​usr/​share/​nginx/​razor/​index.php archive archiveLaterData</​code>​
 +
 +
 +**razor_daily_archive.sh file**
 +<​code>#​!/​bin/​bash
 +php /​usr/​share/​nginx/​razorindex.php archive archiveUsingLog</​code>​
  
 ==== 2.2 Crontab settings ==== ==== 2.2 Crontab settings ====
 +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:
 +<​code>​crontab -e</​code>​
 +
 +and then add the following lines:
 +<​code>#​ System will execute scriptonce every hour and at the fifth minute of the hour.
 +5 * * * * /​var/​www/​cron/​razor_hourly_archive.sh</​code>​
 +
 +<​code>#​ System will execute script once at 1:00 every day.
 +0 1 * * * /​var/​www/​cron/​razor_daily_archive.sh</​code>​
 +
 +<​code>#​ System will execute scriptonce at 0:30 every Sunday.
 +30 0 * * 0 /​var/​www/​cron/​razor_weekly_archive.sh</​code>​
 +
 +<​code>#​ System will execute scriptonceat 0:30 in the first day of every month.
 +30 0 1 * * /​var/​www/​cron/​razor_monthly_archive.sh</​code>​
 +
 +<​code>#​ System will execute scriptonce at 1:30 every day.
 +30 1 * * * /​var/​www/​cron/​razor_laterdata_archive.sh</​code>​
 +
 +Save and exit, then restart cron to enable the schedule
 +<​code>/​etc/​init.d/​cron restart</​code>​
  
 ===== 3 Scheduled tasks in Windows ===== ===== 3 Scheduled tasks in Windows =====
  
 ==== 3.1 Create scheduled tasks ==== ==== 3.1 Create scheduled tasks ====
 +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. 
 +{{:​en:​razor:​20150915000.png}} 
 +Click ‘Add Scheduled Task’ and name the task e.g. “Razor Hourly Archive”. Schedule the task as following.{{:​en:​razor:​20150915001.png}}
 ==== 3.2 scheduled tasks settings ==== ==== 3.2 scheduled tasks settings ====
 +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”:
 +<​code>​php "​D:​\xampp\htdocs\razor\web\index.php"​ archive archiveHourly</​code>​
 +Every 10 minutes from each hour, this hourly task should be run. This is configured in “Schedule” tab:
 +
 +{{:​en:​razor:​20150915002.png}}
 +{{:​en:​razor:​20150915003.png}}
 +
 +**2. Weekly Archive Task**
 +
 +Run
 +<​code>​php "​D:​\xampp\htdocs\razor\web\index.php"​ archive archiveWeekly</​code>​
 +
 +Every week’s 12:20 will start the weekly task:
 +
 +{{:​en:​razor:​20150915004.png}}
 +
 +**3. Monthly Archive Task**
 +
 +Run:
 +
 +<​code>​php "​D:​\xampp\htdocs\razor\web\index.php"​ archive archiveMonthly</​code>​
 +
 +Every month’s 01:20 will start the weekly task:
 +
 +{{:​en:​razor:​20150915005.png}}
 +
 +**4. LaterData Archive Task**
 +<​code>​php "​D:​\xampp\htdocs\razor\web\index.php"​ archive archiveLaterData</​code>​
 +
 +{{:​en:​razor:​20150915006.png}}
 +
 +**5. Daily Archive Task**
 +<​code>​php "​c:​\xampp\htdocs\razor\web\index.php"​ archive archiveUsingLog</​code>​
 +
 +{{:​en:​razor:​20150915007.png}}
 ===== 4 Web Cron ===== ===== 4 Web Cron =====
 +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.//
 +
  
 ===== 5 Next Step – Configuration ===== ===== 5 Next Step – Configuration =====
 +In order to make more functions in Cobub Razor available, user can visit:
  
 +  * [[en:​razor:​configuration|Configuration]]
en/razor/auto-archiving.1426646102.txt.gz · 最后更改: 2017/07/14 11:12 (外部编辑)