rsync

 rsync  is a command line tool to copy files from one server to another, which can be used for incremental backups or migrating web hosts.

IndieWeb Examples

 * - I use rsync to back up all my web servers onto a backup server at home. A cron job runs nightly and rsyncs the entire "web" folder on all my servers
 * undefined - 2019-02-24…03-04 (starting at 2019/Austin) used rsync, specifically a command line similar to the example given, as a key part of a successful migration of all (10 of) my websites from one webhost to another.

Example Commands
The command below can be used to migrate a website from one host to another. This would be run on the host you are migrating from.

Doing it from the 'from' host (pushing) is better than from the 'to" host (pulling) because this avoids an errant temporary sshkey entry in the ~/.ssh/known_hosts file on your destination (new) host. (You could swap the order of the from and to paths if you wanted to run this on the new host and pull from the old host, but this is the reason not to do that.)

rsync -avz --delete --progress ~/aaronpk.com/public_html/ aaronpk@caldera.dreamhost.com:~/aaronpk.com/

Details
 * - "archive mode" - enables rlptgoD, disables HAX
 * - recurse into directories
 * - copy symlinks as symlinks. without this, it would follow symlinks and copy the files, which can lead to duplicate data at the destination. however this can also cause missing data if there are symlinks at the source that are linked to things outside the folder you're copying.
 * - preserve permissions of the files you're copying
 * - preserve modification times
 * - preserve group
 * - preserve owner (only works if you are the superuser at the destination, otherwise has no effect)
 * - preserve device files (only works for superuser), preserve special files
 * - this option preserves hardlinks, so "a" disables it
 * - this option preserves acls, so "a" disables it
 * - this option preserves extended attributes, so "a" disables it
 * - "verbose" shows each file that is copied
 * - compresses data in transit, can significantly speed things up
 * - removes any files at the destination that are not present in the source folder. Make sure you don't have anything at the destination you care about if you include this!
 * - will report the progress as a percentage so that you can see how far along the copy is
 * - The first path is where to copy from.
 * By including the trailing slash, this will copy the entire contents of this folder, including hidden files, which would not be included if you specified.
 * The files will be created at the remote destination directly, the "public" folder will not be created at the destination.
 * - The second path is where to copy to.
 * - This should match however you SSH into your new server. username @ hostname
 * - This is a separator between the SSH command and the path
 * - The tilde is the home directory, then specify the folder of the web root at the new host. Make sure to include the trailing slash in order to get the files to end up in the right spot