summaryrefslogtreecommitdiff
path: root/backupStatistics.in
diff options
context:
space:
mode:
Diffstat (limited to 'backupStatistics.in')
-rw-r--r--backupStatistics.in36
1 files changed, 19 insertions, 17 deletions
diff --git a/backupStatistics.in b/backupStatistics.in
index d5511bf..b0a0062 100644
--- a/backupStatistics.in
+++ b/backupStatistics.in
@@ -2,7 +2,8 @@
# backupStatistics version #VERSION#
-. #ETCDIR#/backup.conf
+[ -r "#ETCDIR#/backup.conf" ] && \
+ . "#ETCDIR#/backup.conf"
do_stage()
{
@@ -108,19 +109,20 @@ do_stage()
usage()
{
- >&2 echo 'Usage: backupStatistics [OPTION]'
- >&2 echo 'Search and tidy duplicate and not-hardlinked files in the backups.'
- >&2 echo ''
- >&2 echo 'With no options, tidy up all backups. THIS CAN BE VERY TIME CONSUMING.'
- >&2 echo ''
- >&2 echo 'Mandatory arguments to long options are mandatory for short options too.'
- >&2 echo ' -d | --dummy only generate lists, do not modify backupfiles'
- >&2 echo ' -h | --help display this help and exit'
- >&2 echo ' -m | --max=maxNum stop execution after step maxNum'
- >&2 echo ' -s | --skip=skipNum skip first skipNum steps'
- >&2 echo ' -V | --version display version and exit'
- >&2 echo ''
- >&2 echo 'the executed steps are:'
+ >&2 echo \
+'Usage: backupStatistics [OPTION]
+Search and tidy duplicate and not-hardlinked files in the backups.
+
+With no options, tidy up all backups. THIS CAN BE VERY TIME CONSUMING.
+
+Mandatory arguments to long options are mandatory for short options too.
+ -d, --dummy only generate lists, do not modify backupfiles
+ -m, --max=maxNum stop execution after step maxNum
+ -s, --skip=skipNum skip first skipNum steps
+#HELPTEXT# #
+
+the executed steps are:'
+
for ((stage=1; stage<=#NUMSTAGES#; stage++))
do
>&2 echo ''
@@ -132,7 +134,7 @@ usage()
}
eval set -- "$(
- getopt -o dhm:s:V \
+ getopt -o dm:s: \
--long dummy \
--long help \
--long max: \
@@ -151,7 +153,7 @@ while true; do
-d|--dummy)
dummy=true
;;
- -h|--help)
+ --help)
usage 0
;;
-m|--max)
@@ -162,7 +164,7 @@ while true; do
shift
skipNum=$1
;;
- -V|--version)
+ --version)
>&2 echo '#VERSION#'
exit 0
;;