Commit ff31ea06 authored by Bjoern Nachtwey's avatar Bjoern Nachtwey
Browse files

just to put everything to a branch

parent d76edcf3
#! /bin/bash
today=$(date +"%F")
# gathering binary
gathbin=/TSM/bin/get-accounting.sh
# reporting mail
##repmail=gwdgacct@gwdg.de
infomail=tsmadm@gwdg.de
# enter logging folder
cd /TSM/Accounting/
# collect data and report
for srv in $(echo 110 111 112 130 131 182 230 231 232 233 234 235 236 237)
do
$gathbin tsm$srv && mv usage.tsm$srv.out $today.accounting.$srv && cat $today.accounting.$srv | mailx -s "TSM$srv Usage $(date)" $repmail $infomail
done
# collect data only
for srv in $(echo 180 184 215 237
283 285 286 TSM-MI)
do
echo tsm$srv;
$gathbin tsm$srv && mv usage.tsm$srv.out $today.accounting.$srv && cat $today.accounting.$srv | mailx -s "TSM$srv Usage $(date)" $infomail
done
\ No newline at end of file
#!/bin/sh
#
# generate ADSM space usage listing from `dsmadmc' SELECT output
#
# NOTE: standard output will have some (irrelevant) output from `dsmadmc'
#
# w.j.m jan 2000
# mod wjm 31-aug-2000: do list nodes w/o filespaces (except STANDARD CLIENT)
# NY 2014-08-XX recoded
# NY 2014-09-19 some fixes, e.g. output path
#
###############################################################################
output=/TSM/Accounting/usage.$1.out # <<<<< output listing file
tmp1=/tmp/$(basename "$0")_$$.1
tmp2=/tmp/$(basename "$0")_$$.2
adsm_cmd="dsmadmc -se=$1 -id=monitor -pa=tsm28mon -dataonly=y"
${adsm_cmd} -noconfirm -tabdelimited << @EOF
select node_name, domain_name -
from nodes where domain_name <> 'TPL'-
> ${tmp1}
select node_name, filespace_name, sum(num_files), sum(logical_mb), -
sum(physical_mb) -
from occupancy -
group by node_name, filespace_name -
> ${tmp2}
@EOF
echo "ADSM statistics as of $(date)" > ${output}
echo "" >> ${output}
echo "" >> ${output}
awk '
BEGIN {
FS ="\t";
nf = 1;
}
nf == 1 {
domain[$1] = $2;
if($1 != "CLIENT" && $2 != "STANDARD") {
printf "%s\t%s\n",$2,$1; # dom, node
}
next;
}
nf == 2 {
printf "%s\t%s\n",domain[$1],$0; # dom, node, fs, #f, log, phy
}
' ${tmp1} nf=2 ${tmp2} | # end of 1st `awk' command
sort |
awk '
BEGIN {
FS = "\t";
cur_inst = "";
total_n = 0;
total_mb = 0;
total_pmb = 0;
}
substr($1,1,4) != cur_inst { # new institut
if(cur_inst != "") {
finish_inst();
printf "\n";
}
cur_inst = substr($1,1,4);
printf "** Institut %s\n",cur_inst;
inst_n = 0;
inst_mb = 0;
inst_pmb = 0;
cur_dom = cur_inst "????";
# drop thru
}
$1 != cur_dom { # new domain
if(cur_dom != cur_inst "????") {
finish_dom();
printf "\n";
}
cur_dom = $1;
printf "* Domain %s\n",cur_dom;
dom_n = 0;
dom_mb = 0;
dom_pmb = 0;
cur_node = "";
# drop thru
}
$2 != cur_node { # new node
if(cur_node != "") finish_node();
cur_node = $2;
printf " %s\n",cur_node;
node_n = 0;
node_mb = 0;
node_pmb = 0;
# drop thru (except for "short" record)
}
$6 != "" { # handle filespace ("long" record)
printf "%-40.40s%12d files, %15.0f MB\n"," " $3,$4,$5;
node_n += $4;
node_mb += $5;
node_pmb += $6;
}
END {
finish_total();
}
func finish_node() {
dom_n += node_n;
dom_mb += node_mb;
dom_pmb += node_pmb;
}
func finish_dom() {
finish_node();
printf "%40.40s%12.12s--------%15.15s---\n",
" ","------------","---------------";
printf "%-40.40s%12d files, %15.0f MB\n",
"* Domain " cur_dom " total:",dom_n,dom_mb;
inst_n += dom_n;
inst_mb += dom_mb;
inst_pmb += dom_pmb;
}
func finish_inst() {
finish_dom();
printf "\n";
printf "%-40.40s%12d files, %15.0f MB\n",
"** Institut " cur_inst " total:",inst_n,inst_mb;
printf "%-40.40s%12.12s========%15.15s===\n",
"** =====================================",
"============","===============";
total_n += inst_n;
total_mb += inst_mb;
total_pmb += inst_pmb;
}
func finish_total() {
if(cur_inst != "") finish_inst();
printf "\n\n";
printf "%-40.40s%12d files, %15.0f MB\n",
"*** Grand total:",total_n,total_mb;
printf "***%49.49s %15.0f MB\n",
"Total physical space (not reported above):",total_pmb;
}
' >> ${output} # end of 2nd `awk' command
rm ${tmp1} ${tmp2}
exit
SELECT n.domain_name, n.node_name, cast(float(a.total_mb)/1024 as DEC(8,2)) AS TOTAL_GB FROM nodes n, auditocc a WHERE n.node_name=a.node_name ORDER BY TOTAL_GB DESC
SELECT n.domain_name as dn, n.node_name as nn, o.filespace_name as fsn, sum(o.num_files), sum(o.reporting_mb) -
FROM nodes n, occupancy o WHERE (n.node_name=o.node_name and not (n.domain_name like "TPL%" or n.domain_name like "IBM%")) ORDER BY dn, nn, fsn
SELECT n.domain_name as dn, n.node_name as nn, o.filespace_name as fsn, o.num_files as nf, cast(float(o.reporting_mb)/1024 as DEC(8,2)) AS TOTAL_GB -
FROM nodes n, occupancy o WHERE n.node_name=o.node_name ORDER BY dn, nn, fsn
SELECT n.domain_name as dn, n.node_name as nn, o.filespace_name, sum(o.num_files), sum(o.reporting_mb) -
FROM nodes n, occupancy o WHERE n.node_name=o.node_name ORDER BY dn, nn, o.filespace_name GROUP by nn
\ No newline at end of file
#! /bin/bash
today=$(date "+%F" -d yesterday)
## settings
# initial path
bpath=/mnt/oc_stor_userdata
optfile=/tsm/owncloud.opt
# number of parallel jobs
numjobs=5
##
## check for snapshot and filelist
##
# get latest snapshot for SNAPSHOTROOT
#ssr=$(find $bpath/.snapshot/ -maxdepth 1 -daystart -ctime 1 -name "snap_daily*")
ssr=$(ls -d $bpath/.snapshot/snap_daily.$today*)
if [[ ! $ssr ]]
then
echo "no actual daily snapshot";
exit 2
else
echo "latest snapshot: $ssr"
fi
# get latest filelist
#filelist=$(ls -d $bpath/tsm/GWDG_owncloud_incremental_filelist_$today* )
filelist=$(ls -d tfilelist )
if [[ ! $filelist ]]
then
echo "no actual filelist"
exit 3
else
echo "latest filelist: $filelist"
fi
##
## split file list
##
#split $filelist -d -a3 -n r/$numjobs chunk.
split -d -a3 -n r/$numjobs $filelist chunk.
##
## do parallel backup
##
for i in $(ls chunk.*)
do
echo dsmc incr -filelist=$i -snapshotroot=$ssr -optfile=$optfile -errorlogname=errlog.$i >> $i.log
done
##
## clean up
##
# rm -f chunk.*
#! /bin/bash
#
# 1. check if script is already running (check for PID file)
# 2. umount snapshot if mounted
# 3. check for snapshot on NetApp
# 4. delete if already existing
# 5. create new one
# 6. create new PID file
# 7. run backup using dsmci.pl
# 8. umount snapshot
# 9. remove snapshot
## some settings
# mountpoint
mp=/mnt/oc_stor_userdata
# snapshot path
snp="svm-gwdg.top.gwdg.de:/vol_GWDG_owncloud_ng/.snapshot/tsm"
# E-Mail
email="tsm-team@gwdg.de"
## 1
## 2 -- check if mountpoint is already used / blocked and umount if so
if [[ $(mount | grep $mp) ]]
then
umount $mp
fi
if [[ $(mount | grep $mp) ]]
then
echo "cannot umount snapshot! ABORT" | mail -s "OC-Backup: Cannot umount Snapshot" tsmteam@gwdg.de
exit 15
fi
## 3
## 4
## 5
## 6 -- create new PID file
echo
# intially mount the actual backup snaphot
mount.nfs $snp $mp
if [[ $(mount | grep $mp) ]]
then
echo "mount successful!"
fi
perl -f dsmci.pl
# umount when ready
umount $mp
if [[ ! $(mount | grep $mp) ]]
then
echo "umount successful :-)"
else
echo "umount failed!"
exit 2;
fi
exit 0;
#! /bin/bash
##############################################################################
#
# reorg-tables.sh
#
# doing all reorgs in one script call
#
# (C) 2020 -- 2020 GWDG Göttingen, Bjørn Nachtwey
# mailto:bjoern.nachtwey@gwdg.de
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# changelog
# date version remark
# 2020-08-XX 0.0.1 initial coding using bash
# 2020-08-12 0.1.0 first version put to gitlab
db2 connect to tsmdb1 && \
db2 "reorg table tsmdb1.ACTIVITY_LOG allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AF_BITFILES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AF_SEGMENTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AS_SEGMENTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.ARCHIVE_OBJECTS allow no access use REORG32K" && \
db2 "reorg table tsmdb1.BACKUP_OBJECTS allow no access use REORG32K" && \
db2 "reorg table tsmdb1.BF_AGGREGATE_ATTRIBUTES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.BF_AGGREGATED_BITFILES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.GROUP_LEADERS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.EXPORT_OBJECTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.TSMMON_STATUS allow no access use REORG16K"
#! /bin/bash
##############################################################################
#
# reorg-tables.sh
#
# doing all reorgs in one script call
#
# (C) 2020 -- 2020 GWDG Göttingen, Bjørn Nachtwey
# mailto:bjoern.nachtwey@gwdg.de
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# changelog
# date version remark
# 2020-08-XX 0.0.1 initial coding using bash
# 2020-08-12 0.1.0 first version put to gitlab
db2 connect to tsmdb1 && \
db2 "reorg table tsmdb1.ACTIVITY_LOG allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AF_BITFILES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AF_SEGMENTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.AS_SEGMENTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.ARCHIVE_OBJECTS allow no access use REORG32K" && \
db2 "reorg table tsmdb1.BACKUP_OBJECTS allow no access use REORG32K" && \
db2 "reorg table tsmdb1.BF_AGGREGATE_ATTRIBUTES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.BF_AGGREGATED_BITFILES allow no access use REORG16K" && \
db2 "reorg table tsmdb1.GROUP_LEADERS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.EXPORT_OBJECTS allow no access use REORG16K" && \
db2 "reorg table tsmdb1.TSMMON_STATUS allow no access use REORG16K"
......@@ -5,4 +5,4 @@ today=$(date "+%F")
/opt/tivoli/tsm/client/ba/bin/dsmc i > /tsmshare/gitlab/TSM-Scripts/log/$today.monitor.outlog
mv /tsmshare/gitlab/TSM-Scripts/log/monitor.errlog /tsmshare/gitlab/TSM-Scripts/log/$today.monitor.errlog
find /tsmshare/gitlab/TSM-Scripts/log -name "*monitor*log" -mtime +30 -exec rm -f {} \;
\ No newline at end of file
find /tsmshare/gitlab/TSM-Scripts/log -name "*monitor*log" -mtime +30 -exec rm -f {} \;
\ No newline at end of file
MU2006L6
MU2071L6
MU2082L6
MU2098L6
MU2124L6
MU2168L6
MU2173L6
MU2200L6
MU2308L6
MU2311L6
MU2329L6
MU2330L6
MU2395L6
MU2501L6
MU2520L6
MU2522L6
MU2655L6
MU2664L6
MU2679L6
MU2711L6
MU2750L6
MU2764L6
MU2783L6
MU2822L6
MU2886L6
MU2900L6
MU2908L6
MU2945L6
MU3079L6
MU3144L6
MU3148L6
MU3220L6
MU3240L6
MU3296L6
MU3317L6
MU3354L6
MU3358L6
MU3397L6
MU3401L6
MU3405L6
MU3410L6
MU3414L6
MU3418L6
MU3453L6
MU3459L6
MU3479L6
MU3523L6
MU3528L6
MU3548L6
MU3629L6
MU3631L6
MU3635L6
MU3662L6
MU3663L6
MU3678L6
MU3679L6
MU3683L6
MU3688L6
MU3705L6
MU3710L6
MU3721L6
MU3815L6
MU3820L6
MU3852L6
MU3881L6
MU3914L6
MU3958L6
MU4032L6
MU4036L6
MU4127L6
MU4155L6
MU4156L6
MU4157L6
MU4167L6
MU4170L6
MU4174L6
MU4177L6
MU4190L6
MU4304L6
MU4326L6
MU4370L6
MU4400L6
MU4426L6
MU4468L6
MU4498L6
MU4518L6
MU4576L6
MU4579L6
MU4613L6
MU4662L6
MU4700L6
MU4720L6
MU4747L6
MU4761L6
MU4809L6
MU4901L6
MU4926L6
MU3350L6
MU3493L6
MU3748L6
MU4059L6
MU4479L6
MU4697L6
ND0006L6
This diff is collapsed.
MU4267L6
MU4268L6
MU4296L6
MU4315L6
MU4354L6
MU4355L6
MU4356L6
MU3116L6
MU3307L6
MU3882L6
MU4376L6
MU4390L6
MU2066L6
MU4398L6
MU3188L6
MU3729L6
MU3664L6
MU2514L6
MU2129L6
MU2496L6
MU3575L6
MU4260L6
MU4341L6
MU2176L6
MU2424L6
MU3100L6
MU3194L6
MU4407L6
MU4417L6
MU3380L6
MU3497L6
MU4692L6
MU4313L6
MU3542L6
MU3868L6
MU3928L6
MU4251L6
MU3716L6
MU4494L6
MU3251L6
MU4476L6
MU4581L6
MU4791L6
MU4269L6
MU4799L6
MU4300L6
MU4312L6
MU2247L6
MU2607L6
MU4219L6
MU4910L6
MU4911L6
MU4930L6
MU4934L6
MU4939L6
MU4944L6
MU4952L6
MU4951L6
MU4957L6
MU4967L6
MU3111L6
MU4411L6
MU4276L6
MU3091L6
MU2466L6
MU4302L6
MU3140L6
MU4987L6
MU4661L6
MU2996L6
MU2116L6
MU2209L6
MU4974L6
MU3901L6
MU4928L6
MU4779L6
#! /bin/bash
# grep -v 2021 2021-01-20-co-sm112.csv | grep -v "2020" | grep -v "2019" | grep -v 2018 | cut -f 2 -d"," | sed -e 's/\"//g'> 2021-01-20-co-sm112.txt
for i in $(cat $1); do echo "checkout libv I4lc01_0 $i remove=bulk"; done
for i in $(cat $1); do echo "upd vol $i acc=unav"; done
......@@ -54,9 +54,9 @@ cp $(ls -td 2* | head -n 1)/summary.out $today-summary.out
cp $today-summary.out /tsmshare/OfflineReorg/Summaries/$luser-summary.out
# remove folders containing analysis data
find $sourcepath/ -noleaf -name "20*" -type d -exe