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 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/backup-inventories.sh') 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 -- cgit v1.1