예제 #1
0
 public function createSync()
 {
     $applicationsPaths = $this->getConfigFile('application_params');
     if (TaskManager::check($this->sync_id) === false) {
         $command = $applicationsPaths['php_exe_path'] . " -f  " . dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . "console.php syncdb";
         TaskManager::create($this->sync_id, $command, $this->sync_periodicity, $this->sync_interval, $this->sync_startTime);
     }
     if (TaskManager::check($this->db_backup_id) === false) {
         $backup_path = Yii::app()->params['backups_path'] . DIRECTORY_SEPARATOR . (It::isLinux() ? '`echo "$""(date +\\%a)"`' : '%DATE:~0,3%') . '_long.sql';
         // Schedule daily database backup
         //                $command = $install->getConfigSection('path','mysqldump_exe_path') .
         $command = $applicationsPaths['mysqldump_exe_path'] . ' --user="******"' . ' --password="******"' . ' --result-file="' . $backup_path . '" ' . $this->dbname;
         TaskManager::create($this->db_backup_id, $command, 'daily', 1, '4:00');
     }
     if (TaskManager::check($this->heartbeat_id) === false) {
         $command = $applicationsPaths['php_exe_path'] . " -f  " . dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . "console.php heartbeatreport";
         TaskManager::create($this->heartbeat_id, $command, 'minutely', 10);
     }
 }
예제 #2
0
 protected function startCronTask()
 {
     $command = Yii::app()->params['applications']['php_exe_path'] . " -f  " . dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . "console.php syncstatus";
     $this->clearCronTask($this->cron_process_sync_status_command_id);
     TaskManager::create($this->cron_process_sync_status_command_id, $command, 'minutely', 1);
 }