diff --git a/NEWS b/NEWS index e778c50..4be098c 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ -NEWS: MOBILE-SYNC 29.02.2012 +NEWS: MOBILE-SYNC 21.07.2012 =============================================================================== +# 2.3 (21. July 2012) +Enhancements: + - prints the current date and time using date function into a timestamp file. + # 2.2 (16. April 2012) Bugfixes: - compress() function now compresses the archive based on file ending; diff --git a/sync-example.sh b/sync-example.sh index 39aa74a..4d433ae 100755 --- a/sync-example.sh +++ b/sync-example.sh @@ -26,8 +26,11 @@ host="mercury" # logfile (optional, default=sync.log) #logfile="sync.log" +# timefile (optional, default=sync.time) +#timefile="sync.time" + # Include dependancy, which will parse arguments and do some checking. -. synclib.sh +. ./synclib.sh ########################################################################## # SYNC FUNCTIONS AVAILABLE @@ -51,6 +54,9 @@ host="mercury" # ########################################################################## +# Remove this line when you are done +exit 1 + # Start Sync info "Starting sync from `host $host`..." message "Timeout is set to $timeout." diff --git a/synclib.sh b/synclib.sh index 4cc3ec8..49f0c7d 100644 --- a/synclib.sh +++ b/synclib.sh @@ -1,6 +1,6 @@ # synclib.sh -# Version 2.2 (16. April 2012) +# Version 2.3 (21. July 2012) # Copyright (c) 2010-2012, Ben Morgan # # Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -_version="2.2" +_version="2.3" # Set the colors for the terminal cBOLD="\e[1m" @@ -127,7 +127,8 @@ function synch() { fi } -# Use rsync to interactively keep destination synchronized +# Use rsync to interactively keep destination synchronized. +# I personally do not like this function; it feels 'dirty'. function isynch() { output=$1 # output location to sync to input=$2 # input directory @@ -204,6 +205,9 @@ fi if [[ -z $logfile ]]; then logfile="$startdir/sync.log" fi +if [[ -z $timefile ]]; then + timefile="$startdir/sync.time" +fi # Parse arguments while [ $# -gt 0 ]; do @@ -237,4 +241,5 @@ while [ $# -gt 0 ]; do esac done +date > $timefile printf "\n\n$(date) :: synclib version $_version =====\n" >> $logfile