#!/bin/bash
#                      /usr/local/bin/synctriweekly
# http://crystalfaeries.net/posix/bin/synctriweekly
# celeste:crystalfaery 2020-08-28 19:42:54+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 with my_twin
cd	$HOME		||	exit	-1
echo   "rsync -auvzH $dryrun                  ~/.calendar `my_twin`:~"
rsync -auvzH $dryrun                          ~/.calendar `my_twin`:~
echo   "rsync -auvzH $dryrun        `my_twin`:~/.calendar ~"
rsync -auvzH $dryrun                `my_twin`:~/.calendar ~

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
