-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVULTL.sh
47 lines (47 loc) · 924 Bytes
/
VULTL.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/local/bin/bash
# requires https://github.com/skrp/MKRX
############################# SUMMONS #
# VULTL - vulture to archive data bones
# >++('> -----skrp of MKRX
path_to_minion=${1%/}
# FUNCTIONS ###########################
list () {
index=0
while read -r line
do
TASKLIST[$index]=$line;
((index++));
done < VULTL_QUE # list minions
rm VULT_QUE;
}
task () {
path_to_minion="$1"
for i in "${TASKLIST[@]}"
do
readlink -f "$path_to_minion"/"$i"/dump/* >> VULTL_init;
done
}
trans () {
while read -r line
do
minion=${line%/}
mv "$minion" dump/;
done < VULT_init
rm VULT_init;
}
# ACTION #######################
while true
do
if [ -f VULTL_QUE ]
then
list;
task "$path_to_minion";
sleep 43200;
trans;
d=$( date +%d%m_%H%M%S )
XS "$path_to_minion""dump/" "$path_to_minion" || printf "%s failed\n" "$d" >> VULTL_log;
# pool/ & g/ are the final dump dirs
else
sleep 3600;
fi
done