-
-
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
This file contains hidden or 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/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