Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wildcards work? #48

Closed
bfleming-ciena opened this issue Feb 18, 2015 · 4 comments
Closed

wildcards work? #48

bfleming-ciena opened this issue Feb 18, 2015 · 4 comments

Comments

@bfleming-ciena
Copy link

def get(self, remote_path, local_path='',
recursive=False, preserve_times=False):
"""
Transfer files from remote host to localhost

    @param remote_path: path to retreive from remote host. since this is
        evaluated by scp on the remote host, shell wildcards and

Then call.

scp.get('/var/tmp/user-action_._', ".")

@jbardin
Copy link
Owner

jbardin commented Feb 18, 2015

Looks like that doc needs to be updated. Shell special characters are quoted by default now, with the exception of ~. You can change the behavior of the client by setting SCPClient.sanitize

@bfleming-ciena
Copy link
Author

Thanks! Got it.

@panjacek
Copy link

So how should I use wildcards exactly? some examples would be nice.
Lets say I want to fopy the files which has the following pattern:
/var/tmp/data_pattern_*

@remram44
Copy link
Collaborator

You can create an SCPClient that doesn't escape filenames, and then copy:

scp = SCPClient(ssh.get_transport(),
                sanitize=lambda x: x)
scp.get('/var/tmp/data_patterm_*')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants