diff options
author | David Walter Seikel | 2016-11-08 15:49:56 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-08 15:49:56 +1000 |
commit | 96eda14b7a1caff77da000a9a957b20ab1a1bb6e (patch) | |
tree | ceb91518776a8b36af8f08c155074fb77f5a437a /scripts/backup-sims.sh | |
parent | Reduce default logging level to INFO. (diff) | |
download | opensim-SC-96eda14b7a1caff77da000a9a957b20ab1a1bb6e.zip opensim-SC-96eda14b7a1caff77da000a9a957b20ab1a1bb6e.tar.gz opensim-SC-96eda14b7a1caff77da000a9a957b20ab1a1bb6e.tar.bz2 opensim-SC-96eda14b7a1caff77da000a9a957b20ab1a1bb6e.tar.xz |
Lots of hacking up the scripts to work with the new setup, and more.
Diffstat (limited to '')
-rwxr-xr-x | scripts/backup-sims.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/backup-sims.sh b/scripts/backup-sims.sh new file mode 100755 index 0000000..fb18c18 --- /dev/null +++ b/scripts/backup-sims.sh | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Figure out where we are, most of this mess is to troll through soft links. | ||
4 | PRG="$0" | ||
5 | while [ -h "${PRG}" ] ; do | ||
6 | ls=$(ls -ld "${PRG}") | ||
7 | link=`expr "${ls}" : '.*-> \(.*\)$'` | ||
8 | if expr "${link}" : '.*/.*' > /dev/null; then | ||
9 | PRG="${link}" | ||
10 | else | ||
11 | PRG=$(dirname "${PRG}")/"${link}" | ||
12 | fi | ||
13 | done | ||
14 | PRGDIR=$(dirname "${PRG}") | ||
15 | pushd ${PRGDIR} >/dev/null | ||
16 | PRGDIR=$(pwd) | ||
17 | popd >/dev/null | ||
18 | |||
19 | for i in $(seq 99) | ||
20 | do | ||
21 | j=$(printf "sim%02d" $i) | ||
22 | if [ -e "${PRGDIR}/../config/$j" ] | ||
23 | then | ||
24 | cd ${PRGDIR}/../config/$j | ||
25 | ./backup-sim | ||
26 | # Sleep for a while, so that there is plenty of time to do the backup, | ||
27 | # and we are not keeping the computer very busy if there are lots of sims. | ||
28 | sleep 200 | ||
29 | fi | ||
30 | done | ||