Skip to content

Commit

Permalink
backup-data-wrapper. move epoch before backup exec (#55)
Browse files Browse the repository at this point in the history
* avoid different timestamp from backup starts and ends

NethServer/dev#5975
  • Loading branch information
edospadoni authored Dec 4, 2019
1 parent 96720eb commit 3ec2c2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/sbin/e-smith/backup-data-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

backup=$1
ts=$(date +%Y%m%d%H%M)
epoch=$(date +%s)
cmd="/sbin/e-smith/backup-data -b $backup"
out_dir="/var/log/backup"

Expand All @@ -40,7 +41,6 @@ log="${out_dir}/backup-${backup}-${ts}.log"
output=$($cmd 2>&1 | tee "$log")
exit_code=$?

epoch=$(date +%s)
# exec all scripts inside /etc/backup-data.hooks
for file in /etc/backup-data.hooks/*; do
[ -f "$file" ] && [ -x "$file" ] && "$file" "$backup" "$log" $exit_code "$epoch"
Expand Down

0 comments on commit 3ec2c2c

Please sign in to comment.