- Timestamp:
- Dec 23, 2008, 8:20:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/backup/do-backup.php
r116 r127 4 4 $Database->select_db('backup'); 5 5 6 function mkdirrec($path, $mode)6 function mkdirrec($path, $mode) 7 7 { 8 if (!is_dir($path)) 8 //echo($path.' '.dirname($path)."\n"); 9 if (!is_dir($path)) 9 10 { 10 if (!mkdir($path,$mode)) 11 { 12 mkdirrec(dirname($path),$mode); mkdir($path,$mode); 13 } 11 // if (!mkdir($path, $mode)) 12 // { 13 mkdirrec(dirname($path), $mode); 14 mkdir($path, $mode); 15 // } 14 16 } 15 17 } 16 18 17 $backup = '/ tmp/backup';19 $backup = '/mnt/Samsung500/tmp/backup'; 18 20 mkdirrec($backup, 0777); 19 21 … … 21 23 $Rows = array(); 22 24 $DbResult = $Database->query("SELECT * FROM items WHERE parent=0"); 23 while($Row = $DbResult->fetch_array()) array_push($Rows, $Row);25 while($Row = $DbResult->fetch_array()) array_push($Rows, $Row); 24 26 25 27 while ($Row = array_shift($Rows)) … … 54 56 } else 55 57 { 56 $ftype =filetype($root.'/'.$folder.$file);58 $ftype = filetype($root.'/'.$folder.$file); 57 59 if (($ftype == 'file') || ($ftype == 'link') || ($ftype == '')) 58 60 { 59 61 //echo('Kopiruju '.addslashes($root.'/'.$folder.$file).' na '.addslashes($backup.$root.'/'.$folder.$file)."\n"); 60 exec('cp -u '.addslashes($root.'/'.$folder.$file).' '.addslashes($backup.$root.'/'.$folder.$file));62 exec('cp -u "'.addslashes($root.'/'.$folder.$file).'" "'.addslashes($backup.$root.'/'.$folder.$file).'"'); 61 63 } 62 64 } 63 65 } 64 66 }
Note:
See TracChangeset
for help on using the changeset viewer.