Skip to content

Commit 2d09de4

Browse files
author
Ben Morgan
committed
Version 2.3
1 parent 47a109e commit 2d09de4

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

NEWS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
NEWS: MOBILE-SYNC 29.02.2012
1+
NEWS: MOBILE-SYNC 21.07.2012
22
===============================================================================
33

4+
# 2.3 (21. July 2012)
5+
Enhancements:
6+
- prints the current date and time using date function into a timestamp file.
7+
48
# 2.2 (16. April 2012)
59
Bugfixes:
610
- compress() function now compresses the archive based on file ending;

sync-example.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ host="mercury"
2626
# logfile (optional, default=sync.log)
2727
#logfile="sync.log"
2828

29+
# timefile (optional, default=sync.time)
30+
#timefile="sync.time"
31+
2932
# Include dependancy, which will parse arguments and do some checking.
30-
. synclib.sh
33+
. ./synclib.sh
3134

3235
##########################################################################
3336
# SYNC FUNCTIONS AVAILABLE
@@ -51,6 +54,9 @@ host="mercury"
5154
#
5255
##########################################################################
5356

57+
# Remove this line when you are done
58+
exit 1
59+
5460
# Start Sync
5561
info "Starting sync from `host $host`..."
5662
message "Timeout is set to $timeout."

synclib.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# synclib.sh
22

3-
# Version 2.2 (16. April 2012)
3+
# Version 2.3 (21. July 2012)
44
# Copyright (c) 2010-2012, Ben Morgan <neembi@googlemail.com>
55
#
66
# Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
1515
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1616
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1717

18-
_version="2.2"
18+
_version="2.3"
1919

2020
# Set the colors for the terminal
2121
cBOLD="\e[1m"
@@ -127,7 +127,8 @@ function synch() {
127127
fi
128128
}
129129

130-
# Use rsync to interactively keep destination synchronized
130+
# Use rsync to interactively keep destination synchronized.
131+
# I personally do not like this function; it feels 'dirty'.
131132
function isynch() {
132133
output=$1 # output location to sync to
133134
input=$2 # input directory
@@ -204,6 +205,9 @@ fi
204205
if [[ -z $logfile ]]; then
205206
logfile="$startdir/sync.log"
206207
fi
208+
if [[ -z $timefile ]]; then
209+
timefile="$startdir/sync.time"
210+
fi
207211

208212
# Parse arguments
209213
while [ $# -gt 0 ]; do
@@ -237,4 +241,5 @@ while [ $# -gt 0 ]; do
237241
esac
238242
done
239243

244+
date > $timefile
240245
printf "\n\n$(date) :: synclib version $_version =====\n" >> $logfile

0 commit comments

Comments
 (0)