Skip to content

Instantly share code, notes, and snippets.

@windowsrefund
windowsrefund / gist:3124813
Created July 16, 2012 20:26 — forked from eiwe/gist:3124549
Bash script to copy a list of files with you everywhere you go
#!/bin/bash
[ $# -eq 0 ]&&exit 1
h=$1;shift;cd;s=ssh
[ -s ~/.c ]&&tar -hcf- `cat ~/.c`|$s $h 'tar -xf -'
$s $h "$@";cd `pwd`
@windowsrefund
windowsrefund / gist:3124598
Created July 16, 2012 19:43 — forked from eiwe/gist:3124549
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