This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/tcsh | |
# | |
# by: Johan Carlin | |
# date: 8/9/2014 | |
# purpose: sync folders between computers. Assumes that both are available | |
# on the local network (ie you are using VPN if the host is behind a | |
# firewall) | |
# usage: unisync [ucl] [j.carlin] | |
# get optional input | |
if ($#argv >= 1) then | |
set hostname="$1" | |
else | |
set hostname=ucl | |
endif | |
if ($#argv == 2) then | |
set touser="$2" | |
else | |
set touser=$USER | |
endif | |
set fromdir=/Users/$USER/unibox | |
set todir=/Users/$touser/unibox | |
# auto should mean that we get batch mode if there are no conflicts, and | |
# interactive mode otherwise | |
unison $fromdir "ssh://"$hostname"/"$todir -auto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment