Created
June 12, 2013 14:25
-
-
Save scarolan/5765738 to your computer and use it in GitHub Desktop.
movein.sh - Nice little "move in" script from O'Reilly's excellent Linux Server Hacks book.
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/sh | |
# movein.sh - shamelessly stolen from O'Reilly's excellend "Linux Server Hacks" | |
# http://oreilly.com/pub/h/72 | |
# Version 0.2 - Added some comments and error checking | |
if [ -z "$1" ]; then | |
echo "Usage: `basename $0` hostname" | |
exit | |
fi | |
if [ ! -d ~/.skel ]; then | |
echo "No ~/.skel directory was found. Please create it and add symlinks (or copies) of any files you want to be included." | |
exit 1 | |
fi | |
# Here's the magic, this tars everything in ~/.skel up and pushes it out to the remote machine. | |
# Be careful to make sure there's nothing in ~/.skel that you don't want on the remote host! | |
cd ~/.skel | |
tar zhcf - . | ssh $1 "tar zpvxf -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment