-
Notifications
You must be signed in to change notification settings - Fork 27
/
seed-by-diffs.sh
executable file
·65 lines (56 loc) · 1.61 KB
/
seed-by-diffs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# export the variables created in '.env'
set -a
source .env
set +a
# echo $TEGOLA_PORT
expire_dir=$IMPOSM3_EXPIRE
# this will be essentially treated as a pidfile
queued_jobs="./in_progress.list"
# output of seeded
completed_jobs="./completed.list"
# a directory to place the worked expiry lists
# THIS MUST BE OUTSIDE OF $expire_dir
completed_dir=$IMPOSM3_EXPIRE_PURGED
# assert no other jobs are running
if [[ -f $queued_jobs ]]; then
echo "$queued_jobs exists, is another seed process running?"
exit
else
touch $queued_jobs
if [[ ! $? ]]; then
echo "error writing queue list, exiting"
rm $queued_jobs
exit
fi
fi
# en existance of completed directory
if [[ ! -d $completed_dir ]]; then
echo "$completed_dir directory not found"
echo "mkdir $completed_dir"
mkdir $completed_dir
fi
# files newer than this amount of seconds will
# not be used for this job
imp_time="0.1" # minutes
# sleep $imp_time"m"
imp_list=`find $expire_dir -type f -mmin +$imp_time`
for f in $imp_list; do
echo "$f" >> $queued_jobs
done
for f in $imp_list; do
echo "seeding from $f"
echo "tegola-issue-214 cache seed --config="tegola-env-bake.toml" --tile-list="$(echo $f)" --tile-name-format="/zxy" --min_zoom=4 --max_zoom=14 --overwrite"
tegola-issue-214 cache seed --config="tegola-env-bake.toml" --tile-list="$(echo $f)" --tile-name-format="/zxy" --min_zoom=4 --max_zoom=14 --overwrite
err=$?
if [[ $err != "0" ]]; then
#error
echo "tegola exited with error code $err"
# rm $queued_jobs
exit
fi
echo "$f" >> $completed_jobs
mv $f $completed_dir
done
echo "finished seeding"
# rm $queued_jobs