diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-07-24 23:02:42 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-07-24 23:02:42 +0200 |
commit | dae6ba3db6455f6fc13cb4d89ae8456068b56925 (patch) | |
tree | 544d36c2151c421cd4737ef6389d3df2b64e3e3d | |
parent | Add licence (diff) | |
download | backuper-dae6ba3db6455f6fc13cb4d89ae8456068b56925.tar.xz |
Do preparation process earlier and independent on backup definition process
-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 } |