Changeset 35 for trunk/www/backup.php
- Timestamp:
- Jun 15, 2009, 10:19:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/backup.php
r31 r35 20 20 $ServerId = $this->Backup['Server']; 21 21 $this->Task->Add('Obnovení databáze', array( 22 'php www/shell.php ServerLock '.$ServerId, 22 23 'mysql --silent --skip-column-names -u server'.$ServerId.' -pserver'.$ServerId.' server'.$ServerId.'_mangos -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$ServerId.' -pserver'.$ServerId.' server'.$ServerId.'_mangos', 23 24 'mysql --silent --skip-column-names -u server'.$ServerId.' -pserver'.$ServerId.' server'.$ServerId.'_characters -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$ServerId.' -pserver'.$ServerId.' server'.$ServerId.'_characters', … … 31 32 'mysql --user=server'.$ServerId.' --password=server'.$ServerId.' server'.$ServerId.'_scriptdev2 < temp/wowhosting/scriptdev2.sql', 32 33 'rm -rf temp/wowhosting', 34 'php www/shell.php ServerUnLock '.$ServerId, 33 35 )); 34 36 return('Úloha obnovení databáze ze zálohy zařazena do fronty.'); … … 39 41 $Server = new Server($this->Database, $ServerId); 40 42 $Description = 'MaNGOS r'.$Server->Server['Database']['Emulator']['Revision'].', UDB r'.$Server->Server['Database']['Revision'].', SD2 r'.$Server->Server['Database']['ScriptDev2Revision'].', Client '.$Server->Server['Database']['Emulator']['Client']['Version']; 41 $this->Database->insert('Backup', array('Server' => $ServerId, 'Time' => 'NOW()', 'Description' => $Description ));43 $this->Database->insert('Backup', array('Server' => $ServerId, 'Time' => 'NOW()', 'Description' => $Description, 'Lock' => 1)); 42 44 $this->Id = $this->Database->insert_id; 43 45 $this->Task->Add('Záloha databáze serveru', array( 46 'php www/shell.php ServerLock '.$ServerId, 44 47 'mkdir temp/wowhosting', 45 48 'mysqldump --user=server'.$ServerId.' --password=server'.$ServerId.' --opt server'.$ServerId.'_characters > temp/wowhosting/characters.sql', … … 50 53 'tar -c -j wowhosting > ../backup/wowhosting-'.$this->Id.'.tar.bz2', 51 54 'rm -rf wowhosting', 55 'php www/shell.php BackupUnLock '.$this->Id, 56 'php www/shell.php ServerUnLock '.$ServerId, 52 57 )); 53 58 return('Úloha zálohování byla zařazena do fronty.'); 54 59 } 60 61 function Lock() 62 { 63 $this->Database->update('Backup', 'Id='.$this->Id, array('Lock' => 1)); 64 } 65 66 function UnLock() 67 { 68 $this->Database->update('Backup', 'Id='.$this->Id, array('Lock' => 0)); 69 } 55 70 } 56 71
Note:
See TracChangeset
for help on using the changeset viewer.