The syntax is similar to the "cp" command: the command itself, followed by the source directory, then the destination (backup) directory, like so:
rdiff-backup /home/jizldrangs /usr/backups
When using SSH, use the server name, followed by double colons and the absolute path, like this:
rdiff-backup /home/jizldrangs fileServerName::/home/jizldrangs/backups
As with many command-line tools, there are a lot of options, most importantly the option to include or exclude certain paths or files. See the examples and man page for details on how to fine-tune your backup.
I put this on my netbook and desktop, which are both running Ubuntu Maverick, but my wife's machine had only the sporadic backups I had made to our USB hard drive, and I wanted a more consistent plan. Fortunately, rdiff-backup, being a Python application, also has a Windows version. If you backing up to a local directory or mounted network drive, you are good to go.
If you want to back up over SSH, it gets a little sticky but it can be done. Using the instructions on this post I downloaded plink.exe (the command-line version of Putty), and created a batch file with the following:
"C:\Program Files\rdiff-backup.exe" -v5 --no-hard-links --exclude-symbolic-links --remote-schema "plink.exe -i rsa.ppk %%s rdiff-backup --server" "C:\\Documents and Settings\Mrs. Jizldrangs\My Documents" mrsjizldrangs@myfileserver::/home/mrsjizldrangs/backups-my-docs
This batch resides in the same directory as plink.exe, which is why the full path isn't specified. Here is a breakdown of the arguments:
- no-hard-links and exclude-symbolic-links: these are necessary for windows machines per the blog post above
- remote-schema: The method of contacting a remote server (in our case, an SSH server over plink.exe)
- The last two arguments are the source directory and destination (i.e. backup) directory
- i: the name of the ssh key to use for authentication. I created an SSH keypair using PuttyGen, which generates 2 files, a public key and a private key. I added the contents of the public key to the authorized_keys file on the server, and the argument specified above is the private key, which is also located in the same directory as plink.exe and the batch file
- The %%s tells rdiff-backup to run what follows on the remote server
- rdiff-backup --server: This is run on the remote machine and all it does is start rdiff-backup in server mode
rdiff-backup -v5 --force -r now --exclude **/.subversion/** --exclude **/.gvfs/** --exclude **/.local/** myFileServer::/home/jizldrangs/vengeance-backup ~
Here's a breakdown of the arguments:
- v5: Verbosity level 5. The available levels are 1 being the lowest through 9 which outputs so much info that it is impossible to read. 5 is a nice happy medium as it lists the files it is working on.
- force: this is necessary to add when doing a restore to a directory that already has some version of the files you are trying to restore. In my case, the default Home directory created for me by Linux Mint already had some default folders, so I had to force rdiff-backup to overwrite them with the version from my backup.
- r: specifies a restore
- now: tells rdiff-backup when to restore as of (see the man page for alternative options if you want to go to a past backup)
- exclude: tells rdiff-backup that these folders exist in the backup but not to restore them
- the last two arguments specify where to restore from (i.e. the backup directory) and where to restore to (in my case the Home directory, you can change this to restore somewhere else and have access to multiple versions of your files)
Thanks, that helped a lot :)
ReplyDeleteYou only need one % (%s) in the remote schema on the command line, but two (%%s) in a batch file due to variable expansion.
Imagine an expert tutor taking your online class and doing all your assignments for you. How much more time you would have to compete in sports, make money ...
DeleteHere is the way to specify the path to a given ssh key for rdiff-backup (using ssh.exe, not plink.exe)
ReplyDeleteYou can take the ssh.exe (and its numerous dll) from the cygwin project, place it in the %PATH% or in the same directory as rdiff-backup.
rdiff-backup.exe -v5 --remote-schema "ssh.exe -o StrictHostKeyChecking=no -i path\to\local\sshkeyfile %s rdiff-backup --server" "C:\local\directory" user@remoteserver::/remotedirectory
The "-o StrictHostKeyChecking=no" argument makes ssh less verbose and prevents it to wait for "yes" answer, as it can't add the remoteserver to its known hosts.
By the way, thank you for this interesting article Jizldrangs, it helped a lot in my project.
Baju batik pria dengan pola potongan yang sedang atau di antara slim fit dan reguler dapat di jadikan sebagai pilihan buat anda yang ingin tampil terlihat lebih elegan. Potongan ini tetap membuat badan terlihat lebih langsing meski tidak seketat slim fit dan tidak kaku seperti potongan reguler.
ReplyDeleteTambahan aksesori seperti jam tangan dan gelang akan membuat tampilan mengenakan batik lebih menarik. Selain itu gelang berbahan kulit dapat juga anda kenakan untuk memberi kesan maskulin
ReplyDeleteHarga baju batik mahal bukan menjadi jamin kamu bisa tampil keren ,, namun bagaimana cara kamu berpakaian untuk menunjukkan kelebihan dalam diri kamu dan membuat kamu nyaman.
ReplyDeletenice article, helps alot!
ReplyDeleteNo upfront payments. Pay only after you approve received parts of your paper. Choose a writer to work with. Check writers' ratings, ...
ReplyDeleteRaghib Alma's Perfumes for men in Pakistan | Flowers
ReplyDeleteExplore New Fashion Trends Anytime, Anywhere, New Users Get 15% Off, Fast Shipping For All. Latest Fashion Clothes, Shoes, Handbags, +More, Good Quality at Low Price. Limited Time Offer 80% Exclusive Online Discount. New Season Arrivals 2020.
ReplyDelete