becky_cli/becky/providers/remote_provider.py
def _copy_remote_files(self, files, restore_path, remote_addr, remote_path, ssh_identity_path):
        """
        Copies a list of files from the remote server to the current server in the specified restore folder.
        Uses rsync to copy the files efficiently.
        """
        files_restored = []
        files_skipped = []
        for file in files:
            if file['type'] == 'directory':
                os.makedirs(join_file_path(restore_path, file['name']))
                files_restored.append(file)
            else:
                command = 'scp -i {} {}:{} {}'.format(ssh_identity_path, remote_addr, file['path'], join_file_path(restore_path, file['name']))
                files_restored.append(file)
                os.system(command)
        return files_restored, files_skipped
        # folders = [join_file_path(restore_path, f['name']) for f in files if f['type'] == 'directory']
        # for f in folders:
            # os.makedirs(f)
        # file_paths = [f['path'] for f in files]
        # files_file = tempfile.NamedTemporaryFile(mode="w")
        # files_file.write('\n'.join(file_paths))
        # files_file.flush()
        # print("restore_path", restore_path)
        # print("remote_path", remote_path)
        # import pdb;pdb.set_trace()
        # command = 'rsync -e "ssh -i {}" --files-from {} {}:{} {}'.format(ssh_identity_path, files_file.name, remote_addr, remote_path, restore_path)
        # os.system(command)
        # files_file.close()

        Copies a list of files from the remote server to the current server in the specified restore folder.
        Uses rsync to copy the files efficiently.
        
Copies a list of files from the remote server to the current server in the specified restore folder.
Uses rsync to copy the files efficiently.
Copies a list of files from the remote server to the current server in the specified restore folder . Uses rsync to copy the files efficiently .
def _copy_remote_files(self, files, restore_path, remote_addr, remote_path, ssh_identity_path):
        files_restored = []
        files_skipped = []
        for file in files:
            if file['type'] == 'directory':
                os.makedirs(join_file_path(restore_path, file['name']))
                files_restored.append(file)
            else:
                command = 'scp -i {} {}:{} {}'.format(ssh_identity_path, remote_addr, file['path'], join_file_path(restore_path, file['name']))
                files_restored.append(file)
                os.system(command)
        return files_restored, files_skipped
def _copy_remote_files ( self , files , restore_path , remote_addr , remote_path , ssh_identity_path ) : files_restored = [ ] files_skipped = [ ] for file in files : if file [ 'type' ] == 'directory' : os . makedirs ( join_file_path ( restore_path , file [ 'name' ] ) ) files_restored . append ( file ) else : command = 'scp -i {} {}:{} {}' . format ( ssh_identity_path , remote_addr , file [ 'path' ] , join_file_path ( restore_path , file [ 'name' ] ) ) files_restored . append ( file ) os . system ( command ) return files_restored , files_skipped
Copies a list of files from the remote server to the current server in the specified restore folder.
Copies a list of files from the remote server to the current server in the specified restore folder .
"""
        Copies a list of files from the remote server to the current server in the specified restore folder.
        Uses rsync to copy the files efficiently.
        """ # folders = [join_file_path(restore_path, f['name']) for f in files if f['type'] == 'directory'] # for f in folders: # os.makedirs(f) # file_paths = [f['path'] for f in files] # files_file = tempfile.NamedTemporaryFile(mode="w") # files_file.write('\n'.join(file_paths)) # files_file.flush() # print("restore_path", restore_path) # print("remote_path", remote_path) # import pdb;pdb.set_trace() # command = 'rsync -e "ssh -i {}" --files-from {} {}:{} {}'.format(ssh_identity_path, files_file.name, remote_addr, remote_path, restore_path) # os.system(command) # files_file.close()
self
files
restore_path
remote_addr
remote_path
ssh_identity_path