Skip to content

Instantly share code, notes, and snippets.

@jooh
Created January 5, 2016 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jooh/bbdf2b311017b3453830 to your computer and use it in GitHub Desktop.
Save jooh/bbdf2b311017b3453830 to your computer and use it in GitHub Desktop.
#!/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