Maintenance

  • Home
  • Log in
  • « Idaho tested and working
  • XHTML, HTML and mime types »

Set up rsync machine

Posted by gregster on 05 Jan 2007 in Servers, Activity log

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 someone@machine.uvic.ca:/path/to/a/different/folder/altogether/

This entry was posted by Greg and filed under Servers, Activity log.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2022 by admin • Help • Multiple blogs done right!