prometheus related updates
[distro-setup] / btrbk-run
index 014d85bbf92415d34b46da0eeb387c40e5e8fccc..5388858b946c44640ed18fa25285acfbdcb296ac 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -405,7 +405,7 @@ mkdir -p /var/log/btrbk
 # fine if they go back years.
 log_path=/var/log/btrbk/$(date +%F_%T%:::z).log
 echo copying output to $log_path
-exec &> >(tee -a $log_path)
+exec &> >(ts "%F %T" | tee -a $log_path)
 
 
 if $verbose; then
@@ -718,8 +718,13 @@ fi
 
 if [[ $ret == 0 ]]; then
   for tg in ${targets[@]}; do
+    h=$(ssh root@$tg hostname)
+    rsync -a /var/log/btrbk $tg:/var/log/btrbk/$tg
     ssh root@$tg /usr/local/bin/mail-backup-clean
   done
+  if [[ $source ]]; then
+    rsync -a $source:/var/log/btrbk /var/log/btrbk/$source
+  fi
 fi
 
 mexit $ret