Skip to content
Snippets Groups Projects
Commit 400531c3 authored by Jan Philipp Timme's avatar Jan Philipp Timme
Browse files

Merge branch 'pr20230912' into 'master'

Update HOBSY ID monitor

See merge request !1
parents e13c1694 4e619085
No related branches found
No related tags found
1 merge request!1Update HOBSY ID monitor
#!/bin/bash
REMAINING_LIBRARY_IDS=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select (maximum_value::bigint - (SELECT last_value FROM hshinfo.seq_raw_library_id)) from information_schema.sequences where sequence_schema = 'hshinfo' and sequence_name = 'seq_raw_library_id';")
REMAINING_LIBRARY_IDS=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select sum(max_value - last_value) from pg_sequences where sequencename like 'library_id_range_%';")
REMAINING_LUH_IDS=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select count(*) from hshinfo.luh_id where is_assigned = false;")
echo "P watch_lib_ids remaining_library_ids=$REMAINING_LIBRARY_IDS;2000:;10: hshinfo.seq_raw_library_ids"
echo "P watch_lib_ids remaining_library_ids=$REMAINING_LIBRARY_IDS;800:;10: hshinfo.seq_raw_library_ids"
echo "P watch_luh_ids remaining_luh_ids=$REMAINING_LUH_IDS;2000:;500: hshinfo.usernames_luh with allocated = false"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment