#!/bin/bash

readonly Script_Name="Ramize"

readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script")

# 05:54:15 06/21/2017.
#
#	Fillepath	=	Full Filepath
#	Follpath	=	Full Folderpath


readonly Full_Uncanon_Unreal_Folpath____This_Script=$(dirname "${BASH_SOURCE[0]}")


readonly Original_Working_Dir=$(pwd)


readonly Follpath____Helpers=$(readlink -m "$Follpath____This_Script/../Helpers")

cd "$Follpath____Helpers"

source "Initialize Ramize or Physave"



##############################


cd "$Full_Folpath____Config"

echo "Datetime of last ramize: $Retrieved____Datetime_of_Last_Ramize"
echo
echo " Standardized____Ramize_Path: $Standardized____Ramize_Path"
echo "Standardized____Physave_Path: $Standardized____Physave_Path"


from_path_for_rsync="$Standardized____Physave_Path/"
to_path_for_rsync="$Standardized____Ramize_Path/"

echo
echo "from_path_for_rsync: $from_path_for_rsync"
echo "  to_path_for_rsync: $to_path_for_rsync"

echo
echo
source "$Fillepath____Ramize_Rsync"
result_code="$?"

echo
echo
if [ "$result_code" != 0 ]
then
	echo "Ramize rsync somehow failed!  Result code: $result_code"
	exit $result_code
fi


echo "Ramize rsync succeeded.  Now noting date/time of this ramize..."


Update_Datetime_of_Last_Ramize_to_Now

result_code="$?"



if [ "$result_code" != 0 ]
then
	echo
	echo "Somehow failed to note the date/time of this ramize!  Result code: $result_code"
	exit $result_code
fi

echo "$now_datetime"
echo

echo "All done!"


exit 0