rsync -ai /path/to/source/directory/ /path/to/destination/directory
This uses rsync
to copy all the files from the source directory to the destination directory. If the copying is interrupted, you may restart it by simply giving the same command again.
The -a
option (--archive
) preserves the meta-data of the files (owner, permissions, timestamps, etc.) This is used in subsequent runs to determine what files need to be transferred, and what files don't need to be transferred.
The -i
option (--itemize-changes
) causes rsync
to output information about each transfer.
In a comment you mention that you may want to do this against an AWS S3 bucket.
In that case, you may use
aws s3 sync /path/to/source/directory/ s3://bucket/path/to/destination/directory/
This would presumably also be restartable if your machine removes the connection for whatever reason.
See also
Note: I'm not a user of AWS, so I have no way of testing this.