Add Options 'ONLY_BACKUP' (do not handle existing archives) and 'NO_NEW_BACKUP' (do not backup any host, only handle existing archives).

This commit is contained in:
2020-05-23 15:33:39 +02:00
parent 41e67196d3
commit e6e88c7e7d
7 changed files with 367 additions and 180 deletions

View File

@@ -5,6 +5,64 @@
# --------------------------------------------------- #
# ------------------- Funktionen -------------------- #
#
usage() {
[[ -n "$1" ]] && error "$1"
echo -e "
\033[1mUsage:\033[m
$(basename $0) [OPTION [OPTION ..
\033[1mDescription\033[m
Main Backup Script for hosts maintained by O.OPEN.
\033[1mOptions\033[m
-B
Only Backup host - do not handle (existing) archives.
-N
Do not backup anything, only maintain existing backups - archiving and/or
removing existing backups.
-m
Only backup hosts listed in file conf/manual_hosts.conf. Don't inform anyone,
and also don't restart services.
\033[1mFiles\033[m
\033[1m$(basename $rcopy_conf_file)\033[m: Main Configuration
See folder 'conf' for more configuration files
\033[1mExample:\033[m
Normal Backup
$(basename $0)
Only maintain backup archives - do NOT write new backups
$(basename $0) -N
"
clean_up 1
}
clean_up() {
# Perform program exit housekeeping
rm -rf "$LOCK_DIR"
blank_line
exit $1
}
echolog(){
if [ -n "$2" ];then
case $_DEBUG in
@@ -55,6 +113,11 @@ fatal(){
echolog "\n*** End Update -- no backups are done ***\n\n"
exit 1
}
blank_line() {
echo ""
}
#
# ------------------ Ende Funktionen ---------------- #
# --------------------------------------------------- #