-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend-strom.sh
26 lines (23 loc) · 861 Bytes
/
send-strom.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/bash
set -euxo pipefail
TR_FILES="/opt/visiology/postgres-docker/dump"
if [[ -n $(find $TR_FILES -type f -name "*$(date +%d'.'%m'.'%Y).dump*") ]]
then
cd /etc/strom21 #search scan_cfg
sudo ScanSendService -m:3 #stop STORM-transfer-service if it works
for IP in 192.168.12.{11,12}
do
cp $TR_FILES/*$(date +%d'.'%m'.'%Y)*{md5,dump} /backup/senddir/
sudo ScanSendService -m:2 -i:$IP #start data transfer
echo "start transfer"
#check if file still here
while [[ -n $(find /backup/senddir/ -type f -name "*$(date +%d'.'%m'.'%Y).dump*") ]]
do echo $(date) File still here...
sleep 10
done
sudo ScanSendService -m:3 #stop STORM-transfer-service
done
find /opt/visiology/postgres-docker/dump -type f -name "*$(date +%d'.'%m'.'%Y).dump*" -exec rm {} \;
else
echo "dump files not found in $TR_FILES"
fi