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
---------
- Moved command line arguments after config file load for allowing command line overrides
- Added a config file option equivalent to --dontgetsize
- Added basic install script from osync project
- 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"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
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
if ! type -p "$BASH" > /dev/null
@ -1396,7 +1396,7 @@ function Main
if [ "$BACKUP_FILES" != "no" ]
then
ListDirectories
if [ "$dontgetsize" -ne 1 ] || [ "$DONT_GET_BACKUP_FILE_SIZE" == "no" ]
if [ "$DISABLE_GET_BACKUP_FILE_SIZE" != "yes" ]
then
GetDirectoriesSize
fi
@ -1406,10 +1406,7 @@ function Main
CreateLocalStorageDirectories
fi
if [ "$dontgetsize" -ne 1 ]
then
CheckSpaceRequirements
fi
# Actual backup process
if [ "$BACKUP_SQL" != "no" ]
@ -1462,6 +1459,8 @@ function Usage
exit 128
}
function GetCommandlineArguments
{
# Command line argument flags
dryrun=0
silent=0
@ -1509,13 +1508,14 @@ do
DELETE_VANISHED_FILES="yes"
;;
--dontgetsize)
dontgetsize=1
DISABLE_GET_BACKUP_FILE_SIZE="yes"
;;
--help|-h|--version|-v)
Usage
;;
esac
done
}
CheckEnvironment
if [ $? == 0 ]
@ -1536,6 +1536,7 @@ then
else
LOG_FILE="$LOGFILE"
fi
GetCommandlineArguments "$@"
GetLocalOS
InitLocalOSSettings