Permalink
Browse files

add cronEtl.php

  • Loading branch information...
1 parent d9cfebe commit cf8141a7bb5db22cfbf79ddab0957a4b221c76ff @xianglei committed Aug 7, 2012
Showing with 43 additions and 2 deletions.
  1. +41 −0 cronEtl.php
  2. +1 −1 download.php
  3. +1 −1 libs/classes/class.etl.php
View
@@ -0,0 +1,41 @@
+#!/usr/loca/bin/php
+<?php
+set_time_limit(0);
+include_once "config.inc.php";
+
+$etl = new Etl;
+
+if(count($_SERVER['argv'][0]) == 1)
+{
+ $etl->EtlHelp();
+}
+else
+{
+ foreach ($_SERVER['argv'] as $key => $value)
+ {
+ if(($key % 2) != 0)
+ {
+ switch ($value) {
+ case '-h':
+ $etl->EtlHelp();
+ break;
+
+ case '-r':
+ if(file_exists($env['etl']."/".$_SERVER['argv'][$key+1]))
+ {
+
+ }
+ else
+ {
+ echo "Not found etl setting file\n";
+ }
+ break;
+
+ default:
+
+ break;
+ }
+ }
+ }
+}
+?>
View
@@ -10,7 +10,7 @@
$filename = $env['output_path']."/hive_res.".$_GET['str'].".csv";
$fname = "hive_res.".$_GET['str'].".csv";
if(file_exists($filename))
- {
+ {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
@@ -65,7 +65,7 @@ public function ParseEtl($pFilename)
public function EtlHelp()
{
- echo "Syntax: ".$_SERVER['argv'][0]. " -option value\n";
+ echo "Syntax: ".$_SERVER['argv'][0]. " -option value -option value...\n";
echo "Options description:\n";
echo " -r etl settings ini file\n";
echo " -s Time range start flag\n";

0 comments on commit cf8141a

Please sign in to comment.