1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-12 19:03:42 +01:00

Added more preserve configurable options

This commit is contained in:
deajan 2016-08-17 17:21:32 +02:00
parent 2d49c957de
commit 179f274147
3 changed files with 27 additions and 6 deletions

View File

@ -10,6 +10,8 @@ CHANGELOG
README: FreeBSD execution needs mailer (not found), sudo missing, bash needed, sed missing (see if StripQuotes mandatory)
! update doc on sudoers paths
- Added options to ignore permissions, ownership and groups
- Improved batch runner
- Batch runner works for directories and direct paths
- Fixed batch runner does not rerun obackup on warnings only

View File

@ -2,7 +2,7 @@
###### obackup - Local or Remote, push or pull backup script for files & mysql databases
###### (C) 2013-2016 by Orsiris de Jong (www.netpower.fr)
###### obackup v2.1x config file rev 2016081601
###### obackup v2.1x config file rev 2016081701
###### GENERAL BACKUP OPTIONS
@ -125,6 +125,13 @@ RSYNC_EXCLUDE_FROM=""
## List separator char. You may set an alternative separator char for your directories lists above.
PATH_SEPARATOR_CHAR=";"
## Preserve basic linux permissions
PRESERVE_PERMISSIONS=yes
PRESERVE_OWNER=yes
PRESERVE_GROUP=yes
## On MACOS X, does not work and will be ignored
PRESERVE_EXECUTABILITY=yes
## Preserve ACLS. Make sure source and target FS can hold same ACLs or you'll get loads of errors.
PRESERVE_ACL=no
## Preserve Xattr. MAke sure source and target FS can hold same Xattr or you'll get loads of errors.

View File

@ -2,11 +2,11 @@
PROGRAM="obackup config file upgrade script"
SUBPROGRAM="obackup"
AUTHOR="(C) 2015 by Orsiris \"Ozy\" de Jong"
AUTHOR="(C) 2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obacup - ozy@netpower.fr"
OLD_PROGRAM_VERSION="v1.x"
NEW_PROGRAM_VERSION="v2.x"
PROGRAM_BUILD=2016041201
NEW_PROGRAM_VERSION="v2.1x"
PROGRAM_BUILD=20160817.1
## type -p does not work on platforms other than linux (bash). If if does not work, always as$
if ! type "$BASH" > /dev/null; then
@ -160,8 +160,20 @@ function RewriteConfigFiles {
sed -i'.tmp' '/^RSYNC_EXCLUDE_PATTERN=*/a\'$'\n''RSYNC_INCLUDE_PATTERN=""\'$'\n''' "$config_file"
fi
if ! grep "^RSYNC_INCLUDE_FROM=" "$config_file" > /dev/null; then
sed -i'.tmp' '/^RSYNC_EXCLUDE_FROM=*/a\'$'\n''RSYNC_INCLUDE_FROM=""\'$'\n''' "$config_file"
if ! grep "^PRESERVE_PERMISSIONS=" "$config_file" > /dev/null; then
sed -i'.tmp' '/^PATH_SEPARATOR_CHAR=*/a\'$'\n''PRESERVE_PERMISSIONS=yes\'$'\n''' "$config_file"
fi
if ! grep "^PRESERVE_OWNER=" "$config_file" > /dev/null; then
sed -i'.tmp' '/^PRESERVE_PERMISSIONS=*/a\'$'\n''PRESERVE_OWNER=yes\'$'\n''' "$config_file"
fi
if ! grep "^PRESERVE_GROUP=" "$config_file" > /dev/null; then
sed -i'.tmp' '/^PRESERVE_OWNER=*/a\'$'\n''PRESERVE_GROUP=yes\'$'\n''' "$config_file"
fi
if ! grep "^PRESERVE_EXECUTABILITY=" "$config_file" > /dev/null; then
sed -i'.tmp' '/^PRESERVE_GROUP=*/a\'$'\n''PRESERVE_EXECUTABILITY=yes\'$'\n''' "$config_file"
fi
if ! grep "^PARTIAL=" "$config_file" > /dev/null; then