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

remove unneeded Skips of non existing dirs

parent 4fdff636
No related branches found
No related tags found
1 merge request!79Finetune output
...@@ -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}"
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