Moved command line args after config file for overriding

This commit is contained in:
deajan 2015-04-24 22:31:39 +02:00
parent 4ee08d0814
commit ac20502b3e
2 changed files with 60 additions and 58 deletions

View File

@ -22,6 +22,7 @@ UNDER WORK
CHANGELOG CHANGELOG
--------- ---------
- Moved command line arguments after config file load for allowing command line overrides
- Added a config file option equivalent to --dontgetsize - Added a config file option equivalent to --dontgetsize
- Added basic install script from osync project - Added basic install script from osync project
- Added obackup-batch.sh from osync project to rerun failed backups in row - Added obackup-batch.sh from osync project to rerun failed backups in row

View File

@ -5,7 +5,7 @@
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=1.9pre PROGRAM_VERSION=1.9pre
PROGRAM_BUILD=2404201502 PROGRAM_BUILD=2404201503
## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode ## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode
if ! type -p "$BASH" > /dev/null if ! type -p "$BASH" > /dev/null
@ -1396,7 +1396,7 @@ function Main
if [ "$BACKUP_FILES" != "no" ] if [ "$BACKUP_FILES" != "no" ]
then then
ListDirectories ListDirectories
if [ "$dontgetsize" -ne 1 ] || [ "$DONT_GET_BACKUP_FILE_SIZE" == "no" ] if [ "$DISABLE_GET_BACKUP_FILE_SIZE" != "yes" ]
then then
GetDirectoriesSize GetDirectoriesSize
fi fi
@ -1406,10 +1406,7 @@ function Main
CreateLocalStorageDirectories CreateLocalStorageDirectories
fi fi
if [ "$dontgetsize" -ne 1 ]
then
CheckSpaceRequirements CheckSpaceRequirements
fi
# Actual backup process # Actual backup process
if [ "$BACKUP_SQL" != "no" ] if [ "$BACKUP_SQL" != "no" ]
@ -1462,6 +1459,8 @@ function Usage
exit 128 exit 128
} }
function GetCommandlineArguments
{
# Command line argument flags # Command line argument flags
dryrun=0 dryrun=0
silent=0 silent=0
@ -1509,13 +1508,14 @@ do
DELETE_VANISHED_FILES="yes" DELETE_VANISHED_FILES="yes"
;; ;;
--dontgetsize) --dontgetsize)
dontgetsize=1 DISABLE_GET_BACKUP_FILE_SIZE="yes"
;; ;;
--help|-h|--version|-v) --help|-h|--version|-v)
Usage Usage
;; ;;
esac esac
done done
}
CheckEnvironment CheckEnvironment
if [ $? == 0 ] if [ $? == 0 ]
@ -1536,6 +1536,7 @@ then
else else
LOG_FILE="$LOGFILE" LOG_FILE="$LOGFILE"
fi fi
GetCommandlineArguments "$@"
GetLocalOS GetLocalOS
InitLocalOSSettings InitLocalOSSettings