diff options
-rw-r--r-- | backuper.sh | 12 |
1 files 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 } |