Solved scp, do not import some files

Solved issue

soolan

Member
Credits
626
Hello

I want to copy more than 100 files to another server with scp but I don't want to copy some files.

Since the number of files I don't want to copy is also high, I need to separate them and I need to separate another group of files

the files I don't want to copy start like this

data_01
data_02
.
.
.
data_09

and

text_01
.
.
text_15

the extensions of the files are the same, so it doesn't matter.

I tried the following, but I couldn't get the two conditions to work

scp * --exclude 'data_*' remotei,p.... did not work

scp -r [!data]* remoteip worked but I could not add the second exclude query
 


You can put two exclude statements in the command.

scp -r --exclude 'data_*' --exclude 'text_*' source_directory/ user@remoteip:destination_directory/
 

Members online


Latest posts

Back
Top