#!/bin/bash
#                      /usr/local/bin/rawdog
# http://crystalfaeries.net/posix/bin/rawdog
# celeste:crystalfaery 2017-07-23 01:43:10+00:00

let	result=0	#	success
echo	"`now`	=======	$0	=======	$1	======="	|| let result=1		# counting forwards from beginning of file

if [ "$1" == "--dry-run" ]
	then
		dryrun="--dry-run"	# only testing
	else
		dryrun=""		# do it for real
fi

# sync to server
cd	$HOME		||	exit	-1
echo   "rsync	-auvzH $dryrun	~/.rawdog/output.html	`my_twin`:~/crystalfaeries.net/rawdog.html"
rsync		-auvzH $dryrun	~/.rawdog/output.html 	`my_twin`:~/crystalfaeries.net/rawdog.html
echo   "rsync	-auvzH $dryrun	~/.rawdog/output.html		  ~/crystalfaeries.net/rawdog.html"
rsync		-auvzH $dryrun	~/.rawdog/output.html		  ~/crystalfaeries.net/rawdog.html

# sync with my_twin
# cd	$HOME		||	exit	-1
# echo   "rsync -auvzH $dryrun ~/.rawdog	`my_twin`:~"
# rsync -auvzH $dryrun         ~/.rawdog	`my_twin`:~
# echo   "rsync -auvzH $dryrun		`my_twin`:~/.rawdog	~" 
# rsync -auvzH $dryrun			`my_twin`:~/.rawdog	~

let	result=$?		# save the result code to return as my result code (pass through unless we override with our own error)
echo	"`now`	-------	$0	-------	$1	-------"	|| let result=255	# counting backwards from end of file
exit	$result


syntax highlighted by Code2HTML, v. 0.9.1