Skip to content
Snippets Groups Projects
Commit b980df48 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'finetune-output' into 'master'

Finetune output

See merge request !79
parents 50da1e1c 0f0fb415
No related branches found
No related tags found
1 merge request!79Finetune output
...@@ -158,7 +158,7 @@ EOFhelp ...@@ -158,7 +158,7 @@ EOFhelp
type : $JOBDEF_TYPE $JOBDEF_AUTO type : $JOBDEF_TYPE $JOBDEF_AUTO
log : $JOB_LOGFILE log : $JOB_LOGFILE
target : ${STORAGE_BASEDIR} target : $( echo ${STORAGE_BASEDIR} | sed 's#:[^:]*@#:**********@#' )
EOFbackupinfo EOFbackupinfo
test -z "$STORAGE_BASEDIR" || ( test -z "$STORAGE_BASEDIR" || (
...@@ -201,7 +201,7 @@ EOFbackupinfo ...@@ -201,7 +201,7 @@ EOFbackupinfo
if [ -n "$STORAGE_BASEDIR" ] && [ -x "${DIR_SELF}/transfer.sh" ]; then if [ -n "$STORAGE_BASEDIR" ] && [ -x "${DIR_SELF}/transfer.sh" ]; then
# transfer files # transfer files
cat "$STORAGEFILE" >>"$JOB_LOGFILE" # cat "$STORAGEFILE" >>"$JOB_LOGFILE"
echo "INFO: $(date) - Sending data to storage... ${DIR_SELF}/transfer.sh $JOBDEF_TYPE" | tee -a "$JOB_LOGFILE" echo "INFO: $(date) - Sending data to storage... ${DIR_SELF}/transfer.sh $JOBDEF_TYPE" | tee -a "$JOB_LOGFILE"
touch "${JOB_DONEFILE}.02.STARTTRANSFER" touch "${JOB_DONEFILE}.02.STARTTRANSFER"
# "${DIR_SELF}"/transfer.sh $JOBDEF_TYPE "$JOBDEF_AUTO" 2>&1 | tee -a "$JOB_LOGFILE" # "${DIR_SELF}"/transfer.sh $JOBDEF_TYPE "$JOBDEF_AUTO" 2>&1 | tee -a "$JOB_LOGFILE"
......
...@@ -132,8 +132,6 @@ ...@@ -132,8 +132,6 @@
echo "__REPO__ OK, Backup repository already exists." echo "__REPO__ OK, Backup repository already exists."
echo "--- UNLOCK ... just in case :-)" echo "--- UNLOCK ... just in case :-)"
echo restic unlock ${ARGS_DEFAULT}
color cmd
eval restic unlock ${ARGS_DEFAULT} eval restic unlock ${ARGS_DEFAULT}
color reset color reset
echo echo
......
...@@ -331,87 +331,86 @@ function setAction(){ ...@@ -331,87 +331,86 @@ function setAction(){
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# ----- START BACKUPS # ----- START BACKUPS
( (
for mydir in $sDirs2Backup if [ "$ACTION" = "backup" ]; then
do for mydir in $sDirs2Backup
do
# remove ending slash ... otherwise duplicity will fail # remove ending slash ... otherwise duplicity will fail
mydir=`echo $mydir | sed 's#\/$##g'` mydir=`echo $mydir | sed 's#\/$##g'`
if [ -d "$mydir" ]; then if [ -d "$mydir" ]; then
BACKUP_DIR=$mydir BACKUP_DIR=$mydir
if [ "$ACTION" = "backup" ]; then h2 "`date` STORE $BACKUP_DIR"
h2 "`date` STORE $BACKUP_DIR"
# --- build parameters # --- build parameters
sSafeName=`j_getSafename "$BACKUP_DIR"` sSafeName=`j_getSafename "$BACKUP_DIR"`
sTarget="$( t_backupDirGetTarget $BACKUP_DIR )" sTarget="$( t_backupDirGetTarget $BACKUP_DIR )"
ARGS_BACKUP="${sParamExclude} $( t_getParamBackup )" ARGS_BACKUP="${sParamExclude} $( t_getParamBackup )"
# detect custom backup sets and add its includes and excludes # detect custom backup sets and add its includes and excludes
backupid=`j_getSetnameOfPath "$BACKUP_DIR"` backupid=`j_getSetnameOfPath "$BACKUP_DIR"`
sSpaceReplace="___SPACE___" sSpaceReplace="___SPACE___"
if [ ! -z $backupid ]; then if [ ! -z $backupid ]; then
for sItem in `_j_getvar ${DIRFILE} "${backupid}\-\-include" | sed "s#\ #${sSpaceReplace}#g"` for sItem in `_j_getvar ${DIRFILE} "${backupid}\-\-include" | sed "s#\ #${sSpaceReplace}#g"`
do do
ARGS_BACKUP="${ARGS_BACKUP} $( t_getParamInlude $sItem)" ARGS_BACKUP="${ARGS_BACKUP} $( t_getParamInlude $sItem)"
done done
for sItem in `_j_getvar ${DIRFILE} "${backupid}\-\-exclude" | sed "s#\ #${sSpaceReplace}#g"` for sItem in `_j_getvar ${DIRFILE} "${backupid}\-\-exclude" | sed "s#\ #${sSpaceReplace}#g"`
do do
ARGS_BACKUP="${ARGS_BACKUP} $( t_getParamExlude $sItem)" ARGS_BACKUP="${ARGS_BACKUP} $( t_getParamExlude $sItem)"
done done
fi fi
# --- pre task # --- pre task
h3 "`date` PRE backup task for ${BACKUP_DIR}" h3 "`date` PRE backup task for ${BACKUP_DIR}"
t_backupDirDoPreTasks t_backupDirDoPreTasks
# sCmdPre="$( t_backupDirDoPreTasks )" # sCmdPre="$( t_backupDirDoPreTasks )"
# --- backup # --- backup
h3 "`date` Backup ${BACKUP_DIR}" h3 "`date` Backup ${BACKUP_DIR}"
if [ $doBackup -eq 0 ]; then if [ $doBackup -eq 0 ]; then
echo "SKIP backup" echo "SKIP backup"
else else
sCmd="$( t_backupDirGetCmdBackup )" sCmd="$( t_backupDirGetCmdBackup )"
echo "what: ${BACKUP_DIR}" echo "what: ${BACKUP_DIR}"
echo "target: ${sTarget}" echo "target: ${sTarget}" | sed 's#:[^:]*@#:**********@#'
echo "command: $sCmd" echo "command: $sCmd"
echo echo
color cmd color cmd
$sCmd $sCmd
fetchrc fetchrc
color reset color reset
echo echo
t_rcCheckBackup $myrc "${BACKUP_DIR}" t_rcCheckBackup $myrc "${BACKUP_DIR}"
fi fi
echo echo
# --- post action # --- post action
h3 "`date` POST backup task for ${BACKUP_DIR}" h3 "`date` POST backup task for ${BACKUP_DIR}"
t_backupDirDoPostTasks t_backupDirDoPostTasks
echo echo
touch ${lastbackupfile} touch ${lastbackupfile}
fi
else else
color warning color warning
echo "DIR SKIP $mydir ... does not exist (no error)" echo "DIR SKIP $mydir ... does not exist (no error)"
color reset color reset
fi fi
echo echo
done done
fi
# --- prune # --- prune
if [ $doPrune -eq 0 ]; then if [ $doPrune -eq 0 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment