aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/backup-sims.sh
blob: 06cb7800c65a3a2ababafe3aa5e0342727fed9f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

source common.sh
getPrgDir

for i in $(seq -w 1 99)
do
    if [ -e "${PRGDIR}/../../config/sim${i}" ]
    then
	pushd ${PRGDIR}/../../config/sim${i} >/dev/null
	# Find out the size of the last backup, base our later sleep on that, but do it now before backup-sim packs it away.
	sizeSleep=`sleepPerSize o "$(getSimName ${i})"`
	./backup-sim
	# Sleep for a while, so that there is plenty of time to do the backup,
	# and we are not keeping the computer very busy if there are lots of sims.
	sleep ${sizeSleep}
	popd > /dev/null
    fi
done