public static function getBackup()
 {
     try {
         $return = Configuration::getBackup();
     } catch (Exception $e) {
         throw new RpcException($e->getMessage(), -31001);
     }
     return $return;
 }
 private function backup($file)
 {
     try {
         $backup = SourceConfiguration::getBackup();
         $jobs = unserialize(base64_decode($backup));
         $data = json_encode($jobs);
         $export = @file_put_contents($file, $data);
         if ($export === false) {
             throw new ShellException("Unable to write destination file");
         }
     } catch (DatabaseException $de) {
         throw $de;
     } catch (ShellException $se) {
         throw $se;
     }
     return count($jobs) . " jobs exported to " . $file;
 }