I have a new rsync machine set up (ID and location purposely withheld) for HCMC backups.
The machine is running Ubuntu Edgy Server on a 1GHz machine with 1GB RAM and two HDDs (one 20GB HDD for the OS and one 80GB HDD for data). I installed X Windows, but the machine does not start X on boot. The only service available is rsync over ssh.
To run a sync:
rsync -a '/path/to/local/files' -e ssh --progress --delete remote.machine.uvic.ca:/path/to/remote/files/
Note that the local path does *NOT* contain a trailing slash, but the remote path *DOES* contain a trailing slash. This is critical. As for the rest:
-a is for archive mode, which retains symbolic links, devices, attributes, permissions etc. intact.
-e is for protocol. I'm using ssh here.
--progress is for progress meter. You get a percent done indicator for each file sync-ed.
--delete is for mirroring. It removes files on the remote machine that do not exist on the local machine.
NOTE: in the above command I do not explicitly tell it who I am on the remote machine. It will try to pass the current username to the remote machine in this case.
ANOTHER NOTE: paths are obviously important here. If I do this:
rsync -v -a '/home/popeye' -e ssh --progress --delete remote.machine.uvic.ca:/home/popeye/
I will actually create a new /home/popeye/popeye/ directory on the remote machine. What I actually want to do is this:
rsync -v -a '/home/popeye' -e ssh --progress --delete remote.machine.uvic.ca:/home/
You might want to take the contents of one folder and put them into the root of another:
rsync -v -a /path/to/folder1/ -e ssh --progress --delete firstname.lastname@example.org:/path/to/a/different/folder/altogether/