Show host name and module init date in the start info block
This commit is contained in:
@@ -2,18 +2,24 @@
|
|||||||
|
|
||||||
# start time in seconds
|
# start time in seconds
|
||||||
START=$(date +'%s');
|
START=$(date +'%s');
|
||||||
|
# set init date, or today if not file is set
|
||||||
|
BACKUP_INIT_DATE=$(printf '%(%c)T' $(cat "${BASE_FOLDER}${BACKUP_INIT_CHECK}" 2>/dev/null));
|
||||||
# start logging from here
|
# start logging from here
|
||||||
exec &> >(tee -a "${LOG}");
|
exec &> >(tee -a "${LOG}");
|
||||||
echo "=== [START : $(date +'%F %T')] ==[${MODULE}]====================================>";
|
echo "=== [START : $(date +'%F %T')] ==[${MODULE}]====================================>";
|
||||||
# show info for version always
|
# show info for version always
|
||||||
echo "Script version: ${VERSION}";
|
echo "Script version : ${VERSION}";
|
||||||
# show type
|
# show type
|
||||||
echo "Backup module : ${MODULE}";
|
echo "Backup module : ${MODULE}";
|
||||||
echo "Module version: ${MODULE_VERSION}";
|
echo "Module version : ${MODULE_VERSION}";
|
||||||
# borg version
|
# borg version
|
||||||
echo "Borg version : ${BORG_VERSION}";
|
echo "Borg version : ${BORG_VERSION}";
|
||||||
|
# host name
|
||||||
|
echo "Hostname : ${HOSTNAME}";
|
||||||
# show base folder always
|
# show base folder always
|
||||||
echo "Base folder : ${BASE_FOLDER}";
|
echo "Base folder : ${BASE_FOLDER}";
|
||||||
|
# Module init date (when init file was writen)
|
||||||
|
echo "Module init date: ${BACKUP_INIT_DATE}";
|
||||||
|
|
||||||
# if force check is true set CHECK to 1unless INFO is 1
|
# if force check is true set CHECK to 1unless INFO is 1
|
||||||
# Needs bash 4.0 at lesat for this
|
# Needs bash 4.0 at lesat for this
|
||||||
@@ -76,7 +82,7 @@ elif [ ! -z "${TARGET_HOST}" ]; then
|
|||||||
fi;
|
fi;
|
||||||
# we dont allow special characters, so we don't need to special escape it
|
# we dont allow special characters, so we don't need to special escape it
|
||||||
REPOSITORY="${TARGET_SERVER}${TARGET_FOLDER}${BACKUP_FILE}";
|
REPOSITORY="${TARGET_SERVER}${TARGET_FOLDER}${BACKUP_FILE}";
|
||||||
echo "Repository : ${REPOSITORY}";
|
echo "Repository : ${REPOSITORY}";
|
||||||
|
|
||||||
# check compression if given is valid and check compression level is valid if given
|
# check compression if given is valid and check compression level is valid if given
|
||||||
OPT_COMPRESSION='';
|
OPT_COMPRESSION='';
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ _LOG_FOLDER="/var/log/borg.backup/";
|
|||||||
LOG_FOLDER="";
|
LOG_FOLDER="";
|
||||||
# should be there on everything
|
# should be there on everything
|
||||||
TEMPDIR="/tmp/";
|
TEMPDIR="/tmp/";
|
||||||
|
# HOSTNAME (as set on server)
|
||||||
|
HOSTNAME=$(hostname);
|
||||||
# creates borg backup based on the include/exclude files
|
# creates borg backup based on the include/exclude files
|
||||||
# if base borg folder (backup files) does not exist, it will automatically init it
|
# if base borg folder (backup files) does not exist, it will automatically init it
|
||||||
# base folder
|
# base folder
|
||||||
@@ -41,6 +43,7 @@ INCLUDE_FILE="";
|
|||||||
EXCLUDE_FILE="";
|
EXCLUDE_FILE="";
|
||||||
# backup folder initialzed check
|
# backup folder initialzed check
|
||||||
BACKUP_INIT_CHECK="";
|
BACKUP_INIT_CHECK="";
|
||||||
|
BACKUP_INIT_DATE="";
|
||||||
# one time backup prefix tag, if set will use <tag>.<prefix>-Y-M-DTh:m:s type backup prefix
|
# one time backup prefix tag, if set will use <tag>.<prefix>-Y-M-DTh:m:s type backup prefix
|
||||||
ONE_TIME_TAG="";
|
ONE_TIME_TAG="";
|
||||||
DELETE_ONE_TIME_TAG="";
|
DELETE_ONE_TIME_TAG="";
|
||||||
|
|||||||
Reference in New Issue
Block a user