e92a4c49b3a61cdc62b3f3ce77be5fc03dcb8122

Author
zertrin <zertrin@gmail.com>
Committer
zertrin <zertrin@gmail.com>
Date

Message

v1.1 restart versionning and keeping a CHANGELOG

This time for real.

Diff

This diff is truncated to protect this page.

  1diff --git a/CHANGELOG b/CHANGELOG
  2index e38a0ceba36162477717e50cfe0301bfa0db6811..c34eaed2739da07bb37e7e055f26f8e750985c68 100644
  3--- a/CHANGELOG
  4+++ b/CHANGELOG
  5@@ -1,3 +1,18 @@
  6+v1.1 (2016-09-03)
  7+===================
  8+  * Fix and improve handling of INCLIST and EXCLIST (issue #128)
  9+  * Fix shellcheck error SC2166
 10+  * Fix shellcheck error SC2128
 11+  * Fix shellcheck SC2153 and SC1090
 12+  * Restart versionning and keeping a changelog
 13+  * Add option "--version" or "-V" to show version information about this script and duplicity
 14+
 15+0.9.x (2013-01-14 to 2016-08-31)
 16+================================
 17+Versionning and keeping a changelog up to date has been neglected between 2013-01-14 and 2016-08-31.
 18+
 19+There were no official 0.9.x release, but an automatically generated list of changes that affected `duplicity-backup.sh` or `duplicity-backup.conf.example` is available in the file `CHANGELOG_0.9.x.md`.
 20+
 21 0.8.3 (02 January 2013)
 22 ======================
 23   * FreeBSD portability (du, mail, & shebang) [barofsoap]
 24diff --git a/CHANGELOG_0.9.x.md b/CHANGELOG_0.9.x.md
 25new file mode 100644
 26index 0000000000000000000000000000000000000000..21564987d9a1de7441a863bb7c6aac25700fa26d
 27--- /dev/null
 28+++ b/CHANGELOG_0.9.x.md
 29@@ -0,0 +1,107 @@
 30+Between version 0.10.0 and 0.8.3, versionning had been neglected and no CHANGELOG entry was kept up to date.
 31+
 32+Here is an export from `git log` for all changes that affected `duplicity-backup.sh` or `duplicity-backup.conf.example` between 2013-01-14 and 2016-08-31.
 33+
 34+```
 35+2016-08-31 23:03:09 +0200 - 73adf5d - Fixes related to new warnings coming from the new version of shellcheck
 36+2016-08-31 17:09:28 -0300 - 6ce9a64 - Wrong identation
 37+2016-08-31 16:36:29 -0300 - 4f96d72 - Send notification if stale lock is detected
 38+2016-08-31 15:26:12 -0300 - 465ae13 - Add IFTTT notification service
 39+2016-08-31 15:13:34 -0300 - c9bd2a4 - Add IFTTT notification service
 40+2016-07-13 18:23:27 +0200 - 2f07d0e - Adding -e, --cleanup flag...
 41+2016-07-03 01:07:08 +0200 - 1604d02 - Support mailx from mailutils
 42+2016-06-15 13:38:18 +0200 - 7a84fbd - Fix for issue #128
 43+2016-04-29 15:31:56 +0200 - dcdc081 - changed my mind about where to place NOTIFICATION_SERVICE
 44+2016-04-29 15:27:40 +0200 - b90289d - minor comment changes to notifications
 45+2016-04-28 15:58:49 -0400 - 0501d23 - fixed error
 46+2016-04-28 21:28:54 +0200 - 6dc6d19 - Restore the functionality to specify a custom mail script
 47+2016-04-23 14:15:09 -0400 - 3ffde78 - Adding Pushover notifications
 48+2016-04-06 11:05:19 -0400 - a719668 - added -r flag to bash read to allow backslashes in GPG passphrases
 49+2016-04-01 23:21:19 +0200 - fad4bd2 - Full rework of email handling
 50+2016-03-28 23:47:39 +0200 - f3f4ddc - rework code for email and notifications (more DRY)
 51+2016-03-28 23:21:02 +0200 - 74f637d - Typo
 52+2016-03-25 20:40:46 +0100 - bcd64c1 - first iteration after activation of Travis-CI
 53+2016-03-25 20:00:39 +0100 - 6c63877 - one last cleaning in the conf file with shellcheck
 54+2016-03-25 19:47:29 +0100 - 3797960 - massive cleaning with shellcheck: from 5 errors and 200 warnings to zero
 55+2016-03-24 21:12:17 +0100 - 454d278 - minor changes to the pull request before merging
 56+2016-03-24 20:59:42 +0100 - 471cc9f - minor changes to the pull request before merging
 57+2016-03-16 18:01:49 +0530 - 491b045 - Add storage class option for AWS S3 to specify storage class to be used
 58+2016-02-26 14:56:31 +0800 - 3eabe0d - Add config sample for Slack notifications
 59+2016-02-26 14:54:34 +0800 - fcfa9ac - Add Slack incoming webhook notifications support
 60+2016-02-26 14:44:46 +0800 - 4fca444 - Better comment
 61+2016-01-27 10:50:15 -0500 - ff1e827 - Adding support for custom mail scripts.
 62+2016-01-23 15:12:03 +1100 - 931fe9e - added ftps and ftpes to list of possible destinations
 63+2015-10-19 13:59:34 +0800 - 423a1d3 - Fix typo
 64+2015-10-10 13:31:12 +0200 - 3a48d5a - Fix bug #106 (unary operator expected)
 65+2015-10-08 10:15:56 +0200 - e5d5785 - also send email on cleanup failure + replace introduced tabs with spaces
 66diff --git a/VERSION b/VERSION
 67new file mode 100644
 68index 0000000000000000000000000000000000000000..3a6a8d03ecac65ab901f9e1fcd1957cfd72ec7df
 69--- /dev/null
 70+++ b/VERSION
 71@@ -0,0 +1 @@
 72+v1.1
 73diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 74index a6eaaec949473e0699e38728743f956ab9a08b6f..fbc3060b602d2afa05ef73642b7af13c5c801daa 100755
 75--- a/duplicity-backup.sh
 76+++ b/duplicity-backup.sh
 77@@ -74,6 +74,8 @@ echo "USAGE:
 78     -n, --dry-run              perform a trial run with no changes made
 79     -d, --debug                echo duplicity commands to logfile
 80 
 81+    -V, --version              print version information about this script and duplicity
 82+
 83   CURRENT SCRIPT VARIABLES:
 84   ========================
 85     DEST (backup destination)       = ${DEST}
 86@@ -84,10 +86,27 @@ echo "USAGE:
 87 "
 88 }
 89 
 90+DUPLICITY="$(which duplicity)"
 91+
 92+if [ ! -x "${DUPLICITY}" ]; then
 93+  echo "ERROR: duplicity not installed, that's gotta happen first!" >&2
 94+  exit 1
 95+fi
 96+
 97+
 98+version(){
 99+  # Read the version string from the file VERSION
100+  VERSION=$(<VERSION)
101+
102+  echo "duplicity-backup.sh ${VERSION}"
103+  ${DUPLICITY} --version
104+  exit 0
105+}
106+
107 # Some expensive argument parsing that allows the script to
108 # be insensitive to the order of appearance of the options
109 # and to handle correctly option parameters that are optional
110-while getopts ":c:t:bfvelsnd-:" opt; do
111+while getopts ":c:t:bfvelsndV-:" opt; do
112   case $opt in
113     # parse long options (a bit tricky because builtin getopts does not
114     # manage long options and I don't want to impose GNU getopt dependancy)
115@@ -139,6 +158,9 @@ while getopts ":c:t:bfvelsnd-:" opt; do
116         debug)
117           ECHO=$(which echo)
118         ;;
119+        version)
120+          version
121+        ;;
122         *)
123           COMMAND=${OPTARG}
124         ;;
125@@ -155,6 +177,7 @@ while getopts ":c:t:bfvelsnd-:" opt; do
126     s) COMMAND="collection-status";;
127     n) DRY_RUN="--dry-run ";; # dry run
128     d) ECHO=$(which echo);; # debug
129+    V) version;;
130     :)
131       echo "Option -${OPTARG} requires an argument." >&2
132       COMMAND=""
133@@ -204,7 +227,6 @@ fi
134 LOGDIR="${LOGDIR%/}/"
135 
136 LOGFILE="${LOGDIR}${LOG_FILE}"
137-DUPLICITY="$(which duplicity)"
138 
139 # File to use as a lock. The lock is used to insure that only one instance of
140 # the script is running at a time.
141@@ -245,11 +267,6 @@ size information unavailable."
142