November 27, 2022

Prevent Overwriting Of Files When Using Scp

rsync seems to be the solution the problem. Here’s an example I got from here:

rsync -avz foo:src/bar /data/tmp

The -a option will preserve permissions, directory structure, ownership, and symlinks. You can also specify any of those options individually as well.

-v and -z mean verbose and compress respectively. You don’t really need them although -z is nice if you are copying large files.

Leave a Reply

Your email address will not be published. Required fields are marked *