Home > Uncategorized > 2-way rsync

2-way rsync

I’m working on a project where I need copies of files both at my laptop and at my home dir somewhere else.
I’ve setup an rsync script to do 2-way synchronization between my laptop and the home dir like this:

#!/bin/sh

remote="joar@remote.server.address"
rdir="remote_sync_dir/"
ldir="/home/joar/local_syncdir/"

rsync -e ssh -vaurP $ldir $remote:$rdir
rsync -e ssh -vaurP $remote:$rdir $ldir

Note: to avoid having to type your password for each sync one should setup ssh-keys.

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.