Skip to content

Instantly share code, notes, and snippets.

@windowsrefund
Forked from eiwe/gist:3124549
Created July 16, 2012 19:43
Show Gist options
  • Save windowsrefund/3124598 to your computer and use it in GitHub Desktop.
Save windowsrefund/3124598 to your computer and use it in GitHub Desktop.
Bash script to copy a list of files with you everywhere you go
#!/bin/bash
p(){ printf "\n [ $* ]\n\n"; }
list="$HOME/.syncfiles"; [[ -f $list ]] || { p "$list missing. Won't sync files."; }
[[ $# -eq 0 ]] && { exit 1; }
host="$1"; shift
p=`pwd`
cd
tar --checkpoint -hcf - `cat $list` | ssh $host 'tar -xf -'
ssh $host "$@"
cd $p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment