Skip to content

Instantly share code, notes, and snippets.

@eiwe
Created July 16, 2012 19:33
Show Gist options
  • Save eiwe/3124549 to your computer and use it in GitHub Desktop.
Save eiwe/3124549 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";}
l="$HOME/.syncfiles";[ -f $l ]||{ p "$l missing. Won't sync files.";}
[ $# -eq 0 ]&&{ exit 1;}
h="$1";shift;p=`pwd`;cd
tar -hcf- `cat $l`|ssh $h 'tar -xf -'
ssh $h "$@"
cd $p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment