| Ubuntu Backup With Unison and sshfs |
Ubuntu Backup With Unison and sshfsby Jordan Emmorey v0.1 This work is licensed under a Creative Commons License. 0. TOC and Purpose 0. TOC and PurposeThe purpose of this is paper is to document howto configure backups on a Ubuntu desktop/server using Unison and sshfs. 1. BackgroundI have a hosting account with Dreamhost, they do a bang up job for a discount webhosting company and I would highly recommend them. That being said, I like to take matters into my own hands when it comes to backing up my data. I had ssh keys already setup for web development and testing, and used sshfs to mount my dreamhost home directory on my local Ubuntu desktop. I have a pair of 500GB SATA drives which I use for backing up my data. For this example, we will attempt to backup from test.example.org:/home/jemmorey/backup to my local desktop at /home/jemmorey/mnt/backup/. I will mount my remote home directory via sshfs at /home/jemmorey/otherHomeDir. 2. UseFirst step to backing up with Unison via sshfs is to set up ssh keys between the two servers. Enter file in which to save the key (/home/jemmorey/.ssh/id_dsa): Then you should move the id_dsa.pub out of your .ssh directory, and then scp the file to the server you want to mount via sshfs. scp ~/.ssh/id_dsa.pub This e-mail address is being protected from spambots. You need JavaScript enabled to view it :~/.ssh/authorized_keys Test this via ssh: jemmorey@lappy:~$ ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it id If you see your uid/gid of the remote host, then you are ready to mount via sshfs. To mount, you first need to create the local location you want to mount the remote directory. mkdir /home/jemmorey/otherHomeDir sshfs This e-mail address is being protected from spambots. You need JavaScript enabled to view it :/home/jemmorey /home/jemmorey/otherHomeDir Then we can work on unison and getting our files backed up. sudo apt-get install unison unison-gtk jemmorey@lappy:~$ which unison /usr/bin/unison Now we are ready to craft our backup policy: jemmorey@lappy:~/.unison$ cat default.prf # Unison preferences file root = /home/jemmorey/otherHomeDir/backup root = /mnt/backup With the backup policy in place, we can start unison and backup our files: unison default.prf 3. Resources4. ContactThanks for reading. If you have any comments, suggestions or gripes please feel free to send them along. I'm always hungry for feedback. Thanks. Contact me via email at This e-mail address is being protected from spambots. You need JavaScript enabled to view it . 5. Keywordsunison, backup, , remote, backups, ssfsh, Linux, Ubuntu, server, desktop, 9.10, 9.04, karmic, sshd 6. DisclaimerObsecurities is furnishing this item "as is". Obsecurities does not provide any warranty of the item whatsoever, whether express, implied, or statutory, including, but not limited to, any warranty of merchantability or fitness for a particular purpose or any warranty that the contents of the item will be error-free. In no respect shall obsecurities incur any liability for any damages, including, but limited to, direct, indirect, special, or consequential damages arising out of, resulting from, or any way connected to the use of the item, whether or not based upon warranty, contract, tort, or otherwise; whether or not injury was sustained by persons or property or otherwise; and whether or not loss was sustained from, or arose out of, the results of, the item, or any services that may be provided by Obsecurities. |