def backup(self, id=None, src=None, timestamp=None):
        """
        This runs a backup job outside of the storage api,
        which is useful for performance testing backups
        """
        # Set basic Logging
        logging.basicConfig()
        # Get the lunr logger
        log = logger.get_logger()
        # Output Debug level info
        log.logger.setLevel(logging.DEBUG)
        # Load the local storage configuration
        conf = LunrConfig.from_storage_conf()
        # If no time provided, use current time
        timestamp = timestamp or time()
        # Init our helpers
        volume = VolumeHelper(conf)
        backup = BackupHelper(conf)

        try:
            # Create the snapshot
            snapshot = volume.create_snapshot(src, id, timestamp)

            # For testing non-snapshot speeds
            # snapshot = volume.get(src)
            # snapshot['backup_id'] = id
            # snapshot['origin'] = src
            # snapshot['timestamp'] = 1338410885.0
            # del snapshot['volume']

            print("Created snap-shot: ", pprint(snapshot))

            with self.timeit(snapshot['size']):
                # Backup the snapshot
                print("Starting Backup")
                backup.save(snapshot, id)

        finally:
            # Delete the snapshot if it was created
            if 'snapshot' in locals():
                self._remove_volume(snapshot['path'])
def backup ( self , id = None , src = None , timestamp = None ) : logging . basicConfig ( ) log = logger . get_logger ( ) log . logger . setLevel ( logging . DEBUG ) conf = LunrConfig . from_storage_conf ( ) timestamp = timestamp or time ( ) volume = VolumeHelper ( conf ) backup = BackupHelper ( conf ) try : snapshot = volume . create_snapshot ( src , id , timestamp ) print ( "Created snap-shot: " , pprint ( snapshot ) ) with self . timeit ( snapshot [ 'size' ] ) : print ( "Starting Backup" ) backup . save ( snapshot , id ) finally : if 'snapshot' in locals ( ) : self . _remove_volume ( snapshot [ 'path' ] )
This runs a backup job outside of the storage api,
        which is useful for performance testing backups