rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

Support for several rsync-time-backup jobs run at the very same moment with same log-dir

Open ajutzeler opened this issue 4 years ago • 0 comments

If two jobs are run at the same time with default options, the longer one will crash because of conflicting log files.

Indeed, as the two jobs will log in the same file, the first job to finish will remove it at cleanup and the second will not find the file anymore resulting in a crash.

This can of course already be solved using different --log-dir values but we could make it a bit more robust and allow several concurrent jobs with the default log-dir value by prefixing the log file with a small random string (using /dev/urandom for instance).

The offending line:

539: LOG_FILE="$LOG_DIR/$(date +"%Y-%m-%d-%H%M%S").log"

ajutzeler avatar Jan 26 '20 09:01 ajutzeler