From b4fdb5524411dc51ba60713387d87f532f1d6d02 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 27 Nov 2016 23:53:51 +1000 Subject: Sleep between backups based on size of the backup file. Poor mans "wait for it to finish" guess. --- scripts/backup-inventories.sh | 5 +++-- scripts/backup-sims.sh | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/backup-inventories.sh b/scripts/backup-inventories.sh index 1d753eb..ef74385 100755 --- a/scripts/backup-inventories.sh +++ b/scripts/backup-inventories.sh @@ -24,9 +24,10 @@ mysql --host="${creds[Data Source]}" "${creds[Database]}" --user="${creds[User I -e "select FirstName,LastName from UserAccounts;" -ss | while read user; do # Replace tab with space user=${user// / } + # Find out the size of the last backup, base our later sleep on that, but do it now before backup-inventory packs it away. + sizeSleep=`sleepPerSize i "${user}"` ${PRGDIR}/backup-inventory "${user}" # 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 users. - # My big arsed 1 GB OAR takes about ten minutes to create, and maybe an hour to gitIOR! - sleep 200 + sleep ${sizeSleep} done diff --git a/scripts/backup-sims.sh b/scripts/backup-sims.sh index 2d174b1..a449e41 100755 --- a/scripts/backup-sims.sh +++ b/scripts/backup-sims.sh @@ -9,9 +9,11 @@ do if [ -e "${PRGDIR}/../config/${j}" ] then cd ${PRGDIR}/../config/$j + # 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 200 + sleep ${sizeSleep} fi done -- cgit v1.1