rsync is generous in its functionality and flexible in how you use it. The only bad things it can do are what you tell it. The most important thing that you need to know immediately about
rsync is that you can get a preview of what you are telling it to do before it actually does it. Here is how
- First: Read the man page three times.
- Read one: You will feel a little overwhelmed
- Read two: You will feel OK
- Read three: You will feel good about
Second: Create a shell script in
bashand paste in the contents below, customizing it with your source and destination.
#!/usr/local/bin/bash rsync -vv \ --archive \ --delete \ --compress \ --itemize-changes \ --human-readable \ --partial \ --progress \ $1 \ SOURCE \ DESTINATION
This is a simple call that mirrors a directory, handles interrupted transfers and lets you re-start again, and keeps you informed of just about every single thing that it is doing.
rsyncbut tell it only to preview it’s work, not actually do it. This is called a dry run. It lets you inspect changes, but it doesn’t do them. That is pretty important when it can delete things on either end. At best, it saves you some time having to re-push everything. You can initiate a dry-run by passing the parameter to
rsyncas an argument to this script.
When you omit this argument, the call will execute and do the work for real.
There you have it. This will help you have a pretty good day using