function main() { global $gbl, $sgbl, $login, $ghtml; global $argv; initProgram('admin'); $login->loadAllObjects('vps'); $this->bserver_l = $login->getList('centralbackupserver'); $list = $login->getList('vps'); foreach ($this->bserver_l as $bso) { $bso->setMyselfUp(); } $opt = parse_opt($argv); if (!isset($opt['newarg'])) { $mess = "\n\nThe architecture of centralized backup has been completely rewritten, and now we have per slave backup-server; you will need to supply --newarg=true for this to work. "; $mess .= "More info at http://wiki.lxcenter.org/."; print $mess; log_log("centralbackup_flag", $mess); send_mail_to_admin("Central Backup Failed", $mess); exit; } $this->stopvps = opt_get_single_flag($opt, 'stopvps'); //$stopxen = opt_get_single_flag($opt, 'stopxen'); //$stopopenvz = opt_get_single_flag($opt, 'stopopenvz'); foreach ($list as $l) { $this->backup_one_vps($l); } foreach ((array) $this->global_list as $k => $s) { //$res = rl_exec_get(null, $k, 'remove_scpid', array($backupiddsa)); } }
function notify_admin($action, $parent, $child) { $cclass = $child->get__table(); $cname = $child->nname; $pclass = $parent->getClass(); $pname = $parent->nname; $not = new notification(null, null, 'client-admin'); $not->get(); if (!array_search_bool($cclass, $not->class_list)) { return; } $subject = "{$cclass} {$cname} was {$action} to {$pclass} {$pname} "; send_mail_to_admin($subject, $subject); }