From dae6ba3db6455f6fc13cb4d89ae8456068b56925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sun, 24 Jul 2016 23:02:42 +0200 Subject: Do preparation process earlier and independent on backup definition process --- backuper.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/backuper.sh b/backuper.sh index 3ad50e8..9812e71 100644 --- a/backuper.sh +++ b/backuper.sh @@ -164,10 +164,7 @@ test_input() { } compute_variables() { - UTS="$(date +"%s")" - TS="$(date +"%Y-%m-%d_%H-%M-%S")" FILENAME_BASE="backup_"$NAME"_"$TS"" - RUNDIR="/tmp/backuper_run_dir_$$_$UTS" compute_gpg_recipients } @@ -180,6 +177,10 @@ adjust_file_name() { prepare() { trap 'error_handler' EXIT INT QUIT TERM ABRT HUP ILL TRAP BUS FPE SEGV + + UTS="$(date +"%s")" + TS="$(date +"%Y-%m-%d_%H-%M-%S")" + RUNDIR="/tmp/backuper_run_dir_$$_$UTS" mkdir -p "$RUNDIR" } @@ -277,16 +278,13 @@ start_pipeline() { backup() { test_input - prepare start_pipeline backup_done cleanup } main() { - # This trap is just to exit 1 in case of pre-run failure - # Signal handler will be overwritten before backup - trap 'exit 1' ABRT + prepare load_config } -- cgit v1.2.3