/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to system/backup.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-02 10:23:22 UTC
  • Revision ID: csa@dside.dyndns.org-20080402102322-okib92sicg2dx3o3
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
require("../adei.php");
 
3
 
 
4
/*
 
5
$config = array (
 
6
    "db_server" => "katrin", 
 
7
    "db_name" => "hauptspektrometer"
 
8
);
 
9
*/
 
10
 
 
11
 
 
12
function DoBackup(&$req, &$backup) {
 
13
    
 
14
 
 
15
    try {
 
16
        $reader = $req->CreateReader(REQUEST::READER_FORBID_CACHEREADER);
 
17
        $reader->Backup(&$backup, READER::BACKUP_FULL);
 
18
        unset($reader);
 
19
    
 
20
 
 
21
 
 
22
 
 
23
        
 
24
//      $bzeus  = new ZEUS($srv);
 
25
 
 
26
//      $bzeus = new ZEUS($bprops);
 
27
    
 
28
/*    
 
29
        $zeus = new ZEUS($props);
 
30
        $groups = $zeus->GetGroups();
 
31
            
 
32
        
 
33
        
 
34
        
 
35
        echo $bdb;
 
36
        foreach ($groups as $group) {
 
37
 
 
38
        }
 
39
*/
 
40
/*      
 
41
        $cprops = $props;
 
42
        foreach (array_keys($groups) as $group) {
 
43
            $cprops['db_group'] = $group;
 
44
            $lg = new LOGGROUP($cprops);
 
45
            $zlg = new ZEUSLogGroup($lg);
 
46
            
 
47
            $cache = new CACHE($cprops, $zeus);
 
48
            $cache->Update();
 
49
        }*/
 
50
    } catch(ADEIException $e) {
 
51
        $error = $e->getMessage();
 
52
    }
 
53
    return $error?$error:0;
 
54
}
 
55
 
 
56
 
 
57
 
 
58
 
 
59
$req = new REQUEST($config);
 
60
$list = $req->GetSourceList();
 
61
 
 
62
foreach ($list as $sreq) {
 
63
    $opts = &$sreq->GetOptions();
 
64
    $backup = $opts->Get('backup');
 
65
    if ($backup) {
 
66
        $err = DoBackup($sreq, $backup);
 
67
        if ($err) 
 
68
            echo $sreq->GetLocationString() . ", Error: $err\n";
 
69
    }
 
70
}
 
71
 
 
72
 
 
73
?>
 
 
b'\\ No newline at end of file'