Solved scp, do not import some files

Solved issue

soolan

Member
Joined
Jan 13, 2023
Messages
66
Reaction score
4
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/
 
You can put two exclude statements in the command.

scp -r --exclude 'data_*' --exclude 'text_*' source_directory/ user@remoteip:destination_directory/
I couldn't do it with scp command but with rsync

copies the file even though I use exclude in scp

edit: I solved my problem using the rsync command
 
Last edited:

Members online


Top