aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/backup-inventories.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/backup-inventories.sh b/scripts/backup-inventories.sh
index 642d71d..30f8ac6 100755
--- a/scripts/backup-inventories.sh
+++ b/scripts/backup-inventories.sh
@@ -28,10 +28,13 @@ done < <(grep ConnectionString ${PRGDIR}/../config/config.ini | cut -d '"' -f 2)
28# Only backup those that have not logged on since their last backup, but returning prims from sims will bypass this check. 28# Only backup those that have not logged on since their last backup, but returning prims from sims will bypass this check.
29timestamp=$(ls -o --time-style="+%s" ${PRGDIR}/../backups/.keep | cut -d ' ' -f 5) 29timestamp=$(ls -o --time-style="+%s" ${PRGDIR}/../backups/.keep | cut -d ' ' -f 5)
30touch ${PRGDIR}/../backups/.keep 30touch ${PRGDIR}/../backups/.keep
31# Well it was good in theory, but looks like they broke it in 8.2, no logging in or out updates to GridUser.
31 32
32# Get the user names, and back 'em up. 33# Get the user names, and back 'em up.
34#mysql --host="${creds[Data Source]}" "${creds[Database]}" --user="${creds[User ID]}" --password="${creds[Password]}" \
35# -e "select FirstName,LastName from UserAccounts,GridUser where UserAccounts.PrincipalID=GridUser.UserID and GridUser.Logout>${timestamp};" -ss | while read user; do
33mysql --host="${creds[Data Source]}" "${creds[Database]}" --user="${creds[User ID]}" --password="${creds[Password]}" \ 36mysql --host="${creds[Data Source]}" "${creds[Database]}" --user="${creds[User ID]}" --password="${creds[Password]}" \
34 -e "select FirstName,LastName from UserAccounts,GridUser where UserAccounts.PrincipalID=GridUser.UserID and GridUser.Logout>${timestamp};" -ss | while read user; do 37 -e "select FirstName,LastName from UserAccounts;" -ss | while read user; do
35 # Replace tab with space 38 # Replace tab with space
36 user=${user// / } 39 user=${user// / }
37 ${PRGDIR}/backup-inventory "${user}" 40 ${PRGDIR}/backup-inventory "${user}"