Skip to content

Instantly share code, notes, and snippets.

View chrisb13's full-sized avatar

Christopher Bull chrisb13

View GitHub Profile
@chrisb13
chrisb13 / rsync-bash-function_pull.sh
Last active October 7, 2015 23:32
Bash function for painless rsync.
function servername_pull()
{
if [[ ( $# -eq 0 ) || ( $1 == "--help" ) || ( $1 == "-h" ) ]] ; then
echo "Usage: servername_pull PATH_FROM PATH_TO."
echo "Purpose: rsync function to pull files from servername."
echo " "
echo "Mandatory arguments: "
echo "PATH_FROM: Path on server to Rsync from"
echo "PATH_TO: Path on local to Rsync to"
echo " "
snippet docopt
#see: https://github.com/docopt/docopt
#round brackets mean required square are optional
#download docopt from...
#https://raw.githubusercontent.com/docopt/docopt/master/docopt.py
`!p
import inspect,os
docopt_path=os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+'/docopt.py'