Changeset 39
- Timestamp:
- Jan 31, 2008, 9:11:25 PM (17 years ago)
- Location:
- system
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
system/backup/backup-move.php
r37 r39 1 1 <?php 2 $i = 10; // Po �t z�oh2 $i = 10; // Počet záloh 3 3 $path='/mnt/backup/'; 4 4 $file='backup'; -
system/backup/do-backup.php
r37 r39 1 1 <?php 2 include(' ../html/global.php');2 include('/a/html/global.php'); 3 3 $Database->select_db('backup'); 4 4 5 5 function mkdirrec($path,$mode) 6 6 { 7 if (!is_dir($path)) { 8 if (!@mkdir($path,$mode)) { 7 if (!is_dir($path)) 8 { 9 if (!@mkdir($path,$mode)) 10 { 9 11 mkdirrec(dirname($path),$mode); mkdir($path,$mode); 10 12 } … … 13 15 14 16 $backup = '/tmp/backup'; 15 mkdirrec($backup, 0777);17 mkdirrec($backup, 0777); 16 18 17 19 // Nacti polozky z databaze … … 20 22 while($Row = $DbResult->fetch_array()) array_push($Rows,$Row); 21 23 22 while ($Row = array_shift($Rows)) { 24 while ($Row = array_shift($Rows)) 25 { 23 26 if ($Row['description']) echo('Zalohuji '.$Row['description']."\n"); 24 27 // Nacteni vyjimek 25 28 $DbResult = $Database->query("SELECT * FROM items WHERE parent=".$Row['id']); 26 29 $Exceptions = array(); 27 while($Except = $DbResult->fetch_array()) $Exceptions[$Except['name']] = 1; 30 while($Except = $DbResult->fetch_array()) 31 $Exceptions[$Except['name']] = 1; 28 32 // Prochazeni slozek 29 33 $root = $Row['name']; 30 if ($root[0] !='/') $root = '/'.$root;31 if (!($recursive = (substr($root, strlen($root)-2,2)!='/*'))) $root = substr($root,0,strlen($root)-2);34 if ($root[0] != '/') $root = '/'.$root; 35 if (!($recursive = (substr($root, strlen($root) - 2, 2) != '/*'))) $root = substr($root, 0, strlen($root) - 2); 32 36 $paths = array('.'); 33 37 mkdirrec($backup.$root, 0700); 34 while ($folder = array_shift($paths)) { 35 $handle=opendir($root.'/'.$folder); 36 if ($folder!='.') { 38 while ($folder = array_shift($paths)) 39 { 40 $handle = opendir($root.'/'.$folder); 41 if ($folder != '.') 42 { 37 43 mkdirrec($backup.$root.'/'.$folder, 0700); 38 $folder.='/'; 39 } else $folder=''; 40 while (false!==($file = readdir($handle))) { 41 if ($file != "." && $file != ".." && !(@$Exceptions[$folder.$file])) { 42 if (is_dir($root.'/'.$folder.$file)) { 43 if ($recursive) { array_push($paths,$folder.$file); } 44 } else { 44 $folder .= '/'; 45 } else $folder = ''; 46 while (false !== ($file = readdir($handle))) 47 { 48 if ($file != "." && $file != ".." && !array_key_exists($folder.$file, $Exceptions)) 49 { 50 if (is_dir($root.'/'.$folder.$file)) 51 { 52 if ($recursive) array_push($paths, $folder.$file); 53 } else 54 { 45 55 $ftype=filetype($root.'/'.$folder.$file); 46 if (($ftype=='file')||($ftype=='link')||($ftype=='')) exec('cp -u '.addslashes($root.'/'.$folder.$file).' '.addslashes($backup.$root.'/'.$folder.$file)); 56 if (($ftype == 'file') || ($ftype == 'link') || ($ftype == '')) 57 { 58 //echo('Kopiruju '.addslashes($root.'/'.$folder.$file).' na '.addslashes($backup.$root.'/'.$folder.$file)."\n"); 59 exec('cp -u '.addslashes($root.'/'.$folder.$file).' '.addslashes($backup.$root.'/'.$folder.$file)); 60 } 47 61 } 48 62 } -
system/generators/dns.php
r37 r39 208 208 fputs($File2, $Header); 209 209 210 $D atabase->select('hosts','*','czfree_ip<>""');211 while($Row = $D atabase->fetch_array())210 $DbResult = $Database->select('hosts','*','czfree_ip<>""'); 211 while($Row = $DbResult->fetch_array()) 212 212 { 213 213 $Data = strtolower($Row['name']); … … 221 221 222 222 $DbResult = $Database->query("SELECT network_dns_alias.* FROM `network_dns_alias` JOIN `hosts` ON network_dns_alias.target LIKE hosts.name AND hosts.czfree_ip != ''"); 223 while($Alias = $D atabase->fetch_array())223 while($Alias = $DbResult->fetch_array()) 224 224 { 225 225 $Data = $Alias['name']; -
system/statistic/known_mac.php
r37 r39 1 1 <?php 2 include_once('../ html/global.php');2 include_once('../../html/global.php'); 3 3 $Database->select_db('statistic'); 4 4
Note:
See TracChangeset
for help on using the changeset viewer.