Sebastian De Deyne
Designer & developer at Spatie

Rsync

Rsync is a command line tool to copy files between different hosts.

rsync -a <source> <destination>

The -a flag ensures everything’s copied recursively, ensures permissions are copied correctly, an other things.

Copy a directory from a remote server to your machine:

rsync -av forge@spatie.be:spatie.be/current/public/media/ public/media

By suffixing the source directory with /, its contets are placed inside the destination directory. Otherwhise you’d end up with public/media/media.

If you enjoyed this post, you might be interested in my newsletter. I occasionally send a dispatch with personal stories, things I’ve been working on in the past month, and other interesting tidbits I come across online.