How do I exclude a subdirectory during get with psftp?

769 Views Asked by At

I am using the PuTTY psftp get command to download files recursively from a remote Unix server to my local PC and I need to exclude the vendor subdirectory.

The vendor folder lives under /var/www/html/project/ together with other files and folders.

1

There are 1 best solutions below

0
Martin Prikryl On BEST ANSWER

psftp does not have such functionality.


You would have to use another SFTP client. For example with WinSCP, you can use -filemask switch of its get command:

get -filemask=|vendor/ /remote/path/* C:\local\path\

There is also a guide for converting PSFTP script to WinSCP script.

(I'm the author of WinSCP)