Beispiel #1
0
 public static function run()
 {
     // On a besoin du path où mettre le fichier de backup
     $opts = array('path' => 'y', 'sn' => 'y');
     $r = command::get_runner($opts);
     $options = getopt($r->shortoptions, $r->options);
     $error = false;
     if (!isset($options['path']) || !is_dir($options['path'])) {
         logger::shout('loption --path nest pas valide');
         $error = true;
     }
     if (!isset($options['sn'])) {
         logger::shout('indiquer le shortname --sn ');
         $error = true;
     }
     if ($error) {
         return;
     }
     // $permissions = fileperms($options['path']);
     // logger::shout($options['path'] . ' permissions:' . $permissions. PHP_EOL);
     backup::execute($options['sn'], $options['path']);
 }