The scp
man page shows that the -C
flag can be used for compressing a file on the fly while performing a remote copy -
$ man scp | grep "\-C"
-C Compression enable. Passes the -C flag to ssh(1) to enable compression.
However, when I perform scp
with and without the flag, the file size remains the same -
Without the flag:
$ scp root@remote-host:/path/to/file/* .
Password:
core_dump 100% 7832MB 110.6MB/s 01:10
$ ls -lh
total 7.7G
-rw------- 1 user group 7.7G Jan 4 16:19 core_dump
With the compression flag:
$ scp -C root@remote-host:/path/to/file/* .
Password:
core_dump 100% 7832MB 69.8MB/s 01:52
$ ls -lh
total 7.7G
-rw------- 1 user group 7.7G Jan 4 16:21 core_dump
I've tried several other options but all yield the same result:
$ scp -o Compression=yes root@remote-host:/path/to/file/* .
$ scp -C -o Compression=yes root@remote-host:/path/to/file/* .
$ scp -C -o Compression=yes -o CompressionLevel=9 root@remote-host:/path/to/file/* .
Is there something that I'm missing here?