#1102 Issue closed: Allow multiple 'rear mkbackuponly/restoreonly' running in parallel

Labels: enhancement, fixed / solved / done

jsmeix opened issue at 2016-12-05 11:25:

Current usr/sbin/rear forbids to run
multiple 'rear mkbackuponly/restoreonly' in parallel
with this code:

# Include default config:
source $SHARE_DIR/conf/default.conf
...
# LOCKLESS_WORKFLOWS can run simultaneously with another instance by using a LOGFILE.lockless:
if IsInArray "$WORKFLOW" "${LOCKLESS_WORKFLOWS[@]}" ; then
    LOGFILE="$LOGFILE.lockless"
else
    # When this currently running instance is not one of the LOCKLESS_WORKFLOWS
    # then it cannot run simultaneously with another instance
    # in this case pidof is needed to test what running instances there are:
    if ! has_binary pidof ; then
        echo "ERROR: Required program 'pidof' missing, please check your PATH" >&2
        exit 1
    fi
    # For unknown reasons '-o %PPID' does not work for pidof at least in SLES11
    # so that a manual test is done to find out if another pid != $$ is running:
    for pid in $( pidof -x "$SCRIPT_FILE" ) ; do
        if test "$pid" != $$ ; then
            echo "ERROR: $PROGRAM is already running, not starting again" >&2
            exit 1
        fi
    done
fi
...
# User configuration files, last thing is to overwrite variables if we are in the rescue system:
for config in site local rescue ; do
    test -r "$CONFIG_DIR/$config.conf" && Source "$CONFIG_DIR/$config.conf" || true
done
# Finally source additional configuration files if specified on the command line:
if test "$CONFIG_APPEND_FILES" ; then
...

Because the user config files are read after the test
what is allowed to run simultaneously
settings in user config files cannot change how that
test behaves.

Adding 'mkbackuponly' and 'restoreonly' to the
LOCKLESS_WORKFLOWS would result an
unexpected logfile name.

Therefore I think I have to implement something
in default.conf that allows by default to run
'rear mkbackuponly/restoreonly' in parallel...

jsmeix commented at 2016-12-05 13:45:

With
https://github.com/rear/rear/pull/1103
merged, "Multiple simultaneous backups and/or restores"
work well for me.


[Export of Github issue for rear/rear.]