0

I want to remote copy a directory (multiple actually but this is a simple example), but I want it to NOT copy any .dat files that it find the there.

I am currently using:

scp -r remotemachine:/directory .

But my .dat files are large and so I would rather not include them in the copy.

Thanks.

1

3 Answers 3

0

Unfortunately scp doesn't have any options to filter files. You're better off using rsync:

rsync -rP --exclude '*.dat' user@server:/destination
0

Try mc with its shell link. It should honor [!.dat]* (or similar) filter while copying.

-1

Try this:

scp -r [!.dat]* remotemachine:/directory

and let us know.

2
  • That didn't seem to work. It seems to be coping things from my current local directory. Apr 14, 2016 at 20:35
  • I'll check out the duplication link. Apr 14, 2016 at 20:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .