Sftp download directory while excluding files with certain extension
Did you consider usind rsync
(if you have it available)? It supports an --exclude
option, where you can specify what you wish to exclude:
rsync -av foo@remotehost:/dir/ /localdir/ --exclude .ipa --exclude .ipa.*
Related videos on Youtube
![Richard Knop](https://i.stack.imgur.com/SprKq.jpg?s=256&g=1)
Richard Knop
I'm a software engineer mostly working on backend from 2011. I have used various languages but has been mostly been writing Go code since 2014. In addition, I have been involved in lot of infra work and have experience with various public cloud platforms, Kubernetes, Terraform etc. For databases I have used lot of Postgres and MySQL but also Redis and other key value or document databases. Check some of my open source projects: https://github.com/RichardKnop/machinery https://github.com/RichardKnop/go-oauth2-server https://github.com/RichardKnop
Updated on September 18, 2022Comments
-
Richard Knop almost 2 years
So I know I can download a whole directory like this:
sftp> get -R *
How can I exclude all files with .ipa extension though? I want to download everything except .ipa or .ipa.* files from a directory.
-
rubo77 about 4 yearsthis is not a solution to the question. the question was, how to use sftp