rsync

A file copying tool that sends only the parts that differ between source and destination, locally or over SSH.

With --delete, a wrong source or missing trailing slash can wipe files at the destination.

In more detail

-a preserves permissions, times and links, and --delete removes destination files that no longer exist in the source. A trailing slash on the source copies its contents rather than the directory itself, so notes/ and notes behave differently.

Example

rsync -a --delete notes/ deploy@web01:/srv/notes/

Related terms

Taught in

References

Certification courses