mirror of
https://github.com/deajan/obackup.git
synced 2025-02-05 19:03:50 +01:00
Added ignore backup size option and a cosmetic fix
This commit is contained in:
parent
a96707d17c
commit
37c0f956ea
@ -22,6 +22,8 @@ UNDER WORK
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
- Added --dontgetsize parameter to backup huge systems immediatly
|
||||||
|
- Fixed multiple keep logging messages since sleep time between commands has been lowered under a second
|
||||||
- Create local subdirectories if not exist before running rsync (rsync doesn't handle mkdir -p)
|
- Create local subdirectories if not exist before running rsync (rsync doesn't handle mkdir -p)
|
||||||
- Backported some fixes from Osync
|
- Backported some fixes from Osync
|
||||||
- Lowered sleep time between commands
|
- Lowered sleep time between commands
|
||||||
|
26
obackup.sh
26
obackup.sh
@ -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=0304201501
|
PROGRAM_BUILD=2004201501
|
||||||
|
|
||||||
## 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
|
||||||
@ -51,7 +51,7 @@ fi
|
|||||||
PARTIAL_DIR=".obackup_workdir_partial"
|
PARTIAL_DIR=".obackup_workdir_partial"
|
||||||
|
|
||||||
## Log a state message every $KEEP_LOGGING seconds. Should generally not be equal to soft or hard execution time so your log won't be unnecessary big.
|
## Log a state message every $KEEP_LOGGING seconds. Should generally not be equal to soft or hard execution time so your log won't be unnecessary big.
|
||||||
KEEP_LOGGING=1801
|
KEEP_LOGGING=6
|
||||||
|
|
||||||
## Correct output of all system commands (language agnostic)
|
## Correct output of all system commands (language agnostic)
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
@ -417,6 +417,7 @@ function GetRemoteOS
|
|||||||
function WaitForTaskCompletion
|
function WaitForTaskCompletion
|
||||||
{
|
{
|
||||||
soft_alert=0
|
soft_alert=0
|
||||||
|
log_time=0
|
||||||
SECONDS_BEGIN=$SECONDS
|
SECONDS_BEGIN=$SECONDS
|
||||||
while eval "$PROCESS_TEST_CMD" > /dev/null
|
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||||
do
|
do
|
||||||
@ -424,7 +425,11 @@ function WaitForTaskCompletion
|
|||||||
EXEC_TIME=$(($SECONDS - $SECONDS_BEGIN))
|
EXEC_TIME=$(($SECONDS - $SECONDS_BEGIN))
|
||||||
if [ $((($EXEC_TIME + 1) % $KEEP_LOGGING)) -eq 0 ]
|
if [ $((($EXEC_TIME + 1) % $KEEP_LOGGING)) -eq 0 ]
|
||||||
then
|
then
|
||||||
Log "Current task still running."
|
if [ $log_time -ne $EXEC_TIME ]
|
||||||
|
then
|
||||||
|
log_time=$EXEC_TIME
|
||||||
|
Log "Current task still running."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $EXEC_TIME -gt "$2" ]
|
if [ $EXEC_TIME -gt "$2" ]
|
||||||
then
|
then
|
||||||
@ -1384,14 +1389,20 @@ function Main
|
|||||||
if [ "$BACKUP_FILES" != "no" ]
|
if [ "$BACKUP_FILES" != "no" ]
|
||||||
then
|
then
|
||||||
ListDirectories
|
ListDirectories
|
||||||
GetDirectoriesSize
|
if [ "$dontgetsize" -ne 1 ]
|
||||||
|
then
|
||||||
|
GetDirectoriesSize
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $dryrun -ne 1 ]
|
if [ $dryrun -ne 1 ]
|
||||||
then
|
then
|
||||||
CreateLocalStorageDirectories
|
CreateLocalStorageDirectories
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CheckSpaceRequirements
|
if [ "$dontgetsize" -ne 1 ]
|
||||||
|
then
|
||||||
|
CheckSpaceRequirements
|
||||||
|
fi
|
||||||
|
|
||||||
# Actual backup process
|
# Actual backup process
|
||||||
if [ "$BACKUP_SQL" != "no" ]
|
if [ "$BACKUP_SQL" != "no" ]
|
||||||
@ -1440,6 +1451,7 @@ function Usage
|
|||||||
echo "--partial Allows rsync to keep partial downloads that can be resumed later (experimental)"
|
echo "--partial Allows rsync to keep partial downloads that can be resumed later (experimental)"
|
||||||
echo "--no-maxtime disables any soft and hard execution time checks"
|
echo "--no-maxtime disables any soft and hard execution time checks"
|
||||||
echo "--delete Deletes files on destination that vanished on source"
|
echo "--delete Deletes files on destination that vanished on source"
|
||||||
|
echo "--dontgetsize Does not try to evaluate backup size"
|
||||||
exit 128
|
exit 128
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1453,6 +1465,7 @@ then
|
|||||||
else
|
else
|
||||||
verbose=0
|
verbose=0
|
||||||
fi
|
fi
|
||||||
|
dontgetsize=0
|
||||||
stats=0
|
stats=0
|
||||||
PARTIAL=0
|
PARTIAL=0
|
||||||
# Alert flags
|
# Alert flags
|
||||||
@ -1488,6 +1501,9 @@ do
|
|||||||
--delete)
|
--delete)
|
||||||
DELETE_VANISHED_FILES="yes"
|
DELETE_VANISHED_FILES="yes"
|
||||||
;;
|
;;
|
||||||
|
--dontgetsize)
|
||||||
|
dontgetsize=1
|
||||||
|
;;
|
||||||
--help|-h|--version|-v)
|
--help|-h|--version|-v)
|
||||||
Usage
|
Usage
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user