N
N
NO2014-10-16 10:53:59
linux
NO, 2014-10-16 10:53:59

SCP: How to ignore folders and files?

linux ubuntu. I make backups with the "scp" command:

sshpass -p PASSWORD scp -c blowfish -r [email protected]:./site/ /home/user_pc/backup/

In the "site" folder on the server, there are files and folders that need to be ignored, for example:
"./site/.git" folder and "./site/sitemap.xml" file
How can I do this and is it possible?
Tried it this way:
sshpass -p PASSWORD scp --exclude=./site/.git -c blowfish -r [email protected]:./site/ /home/user_pc/backup/

Outputs:
unknown option -- -
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [host1:]file1 ... [host2:]file2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saenara, 2014-10-16
@Mihail9575

Maybe try rsync -e ssh?
Or find ... -exec scp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question