Skip to main content

rsync with ssh

Setup rsync from laptop to a remote server.
To get this done, I followed the steps described in http://www.jdmz.net/ssh/

The commands that I used:
rsync -avz -e ssh Documents/gnupg-data/ jan@www.jankester.com:/home/jan/backup_rsync
ssh-keygen -t dsa -b 2048 -f .ssh/ewing_ssh_rsync_key

added entry in commands in authorized keys remote
added validate-rsync script on remote under /home/jan/cron

Test again whether new key works
rsync -avz -e ssh -i /home/jan/.ssh/ewing_ssh_rsync_key Documents/gnupg-data/ jan@www.jankester.com:/home/jan/backup_rsync

Now add a script to sync anything you like /home/jan/cron/backup-ewing-on-vs01-05.sh:

#!/bin/sh

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/jan/.ssh/ewing_ssh_rsync_key
RUSER=jan
RHOST=www.jankester.com
RPATH=/home/jan/backup_rsync

LPATH=/home/jan/Documents/gnupg-data
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/.ssh
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/ssh
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/vnc
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/Documents/technical_tips
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/Documents/personal
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

LPATH=/home/jan/.bash*
$RSYNC -azv -e "$SSH -i $KEY" $LPATH $RUSER@$RHOST:$RPATH

Comments

Jan Kester said…
Add parameter --delete to make sure that deleted files on the server also get deleted on the remote backup host.
Jan Kester said…
When connecting to samba share, add parameter --modify-window=10, and use instead of -azv the combinaition -rtzv.

Popular posts from this blog

SSL handshake failed: Secure connection truncated

Got this problem on Ubuntu 9.10 and 10.10. svn co --username=xx https:/yy zz “SSL handshake failed: Secure connection truncated” According to this link bug-ubuntu The solution is: sudo apt-get install libneon27 cd /usr/lib/ sudo rm libneon-gnutls.so.27 sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Interactive selenium testing

The problem Location of elements When I started using selenium, I noticed that it is not easy to do it right. First you start with IDE, but you notice, that the IDE does not really record a lot. In a next step I added firebug, and started analyzing how the elements where to be located: either by tag, id, class etc. Junit testcase With this information I could then create my junit testcase: @Test public void testMapView() throws Exception { //assert that we cannot see submenu of MapCreator elem = driver.findElement(By.className(SeleniumConstants.MAP_SUB_MENU)); String style = elem.getAttribute("style"); assertTrue("Element must have style display off.",style.matches("display: none.*")); logger.debug("Located element " + SeleniumConstants.MAP_SUB_MENU); //find menu and click on mapview elem = driver.findElement(By.id(SeleniumConstants.MAP_CONTROL)); actions.moveToElement(elem).click().perform(); //assert su...

Run jmeter from eclipse

Download jmeter source and binaries: http://archive.apache.org/dist/jakarta/jmeter/binaries/jakarta-jmeter-2.3.4.zip http://archive.apache.org/dist/jakarta/jmeter/source/jakarta-jmeter-2.3.4_src.zip Unpack jmeter source file, and rename eclipse.classpath into .classpath. Add a .project file to the same directory: <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>jakarta-jmeter-2.3.4</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> Now import the source code as eclipse project. Add all libs of binary distribution (lib/*.jar) to the new project's lib dir....