IDS - Informationsverbund Deutschschweiz

Automatische Wartung

Täglicher cleanup Job

Datei liegt unter:
/exlibris/sfx_ver/sfx4_1/sfxglb41/home/cleanup/deletelogfiles.sh

In jeder Instanz wird via symbolic darauf verlinkt.

sfx_basel41:
/exlibris/sfx_ver/sfx4_1/sfx_basel41/home/cleanup/deletelogfiles.sh    sfx_basel41 1> /dev/null 2> /dev/null

sfx_bern41:
/exlibris/sfx_ver/sfx4_1/sfx_bern41/home/cleanup/deletelogfiles.sh sfx_bern41 1> /dev/null 2> /dev/null

sfx_hsg41:
/exlibris/sfx_ver/sfx4_1/sfx_hsg41/home/cleanup/deletelogfiles.sh sfx_hsg41 1> /dev/null 2> /dev/null

sfx_ilu41:
/exlibris/sfx_ver/sfx4_1/sfx_ilu41/home/cleanup/deletelogfiles.sh sfx_ilu41  1> /dev/null 2> /dev/null

sfx_uzh41:
/exlibris/sfx_ver/sfx4_1/sfx_uzh41/home/cleanup/deletelogfiles.sh sfx_uzh41 1> /dev/null 2> /dev/null

sfx_zbz41:
/exlibris/sfx_ver/sfx4_1/sfx_zbz41/home/cleanup/deletelogfiles.sh sfx_zbz41 1> /dev/null 2> /dev/null

sfxlcl41:
/exlibris/sfx_ver/sfx4_1/sfxlcl41/home/cleanup/deletelogfiles.sh sfxlcl41 1> /dev/null 2> /dev/null

Google scholar monthly export

cronjob fuer jede instanz
#SFX3
/exlibris/sfx_ver/sfx_version_3/sfx_uzh3/admin/kbtools/export.cron --format=GOOGLE
 --object_type=JOURNAL --object_type=BOOK --mode=manual

Cleanup Revision Update Folders

deletekbfiles.sh
#!/bin/bash
#
# this script removes sfx kb update files from
# /exlibris/sfx_ver/sfx4_1/tmp/rev-up-downloads
# /exlibris/sfx_ver/sfx4_1/tmp/backup
# /exlibris/sfx_ver/sfx4_1/tmp
#
# Lars Haendler - 29/04/2011
#
 
find /exlibris/sfx_ver/sfx4_1/tmp/rev-up-downloads -type f  -mtime +180  -exec rm -f {} \;
find /exlibris/sfx_ver/sfx4_1/tmp/backup -type f  -mtime +180  -exec rm -f {} \;
find /exlibris/sfx_ver/sfx4_1/tmp -type f  -mtime +180  -exec rm -f {} \;
 
exit 0
root cronjob
00 1 1 * * /exlibris/sfx_ver/sfx4_1/cleanupjobs/deletekbfiles.sh 1> /dev/null 2> /dev/null

Discspace salux-prod02.ethz.ch

CRON discspacemail.sh
#!/bin/bash
# File: discspacemail.sh
# sends "df -h" to mail adresses
#
# Lars Haender - 30/06/2009
#              - 18/04/2011
#
df -h | mailx -s "Server Report - discspace filesystem" ids@hbz.uzh.ch
exit 0
root cronjob
0 4 1 * * /exlibris/sfx_ver/sfx4_1/cleanupjobs/discspacemail.sh 1> /dev/null 2> /dev/null
Beispiel einer Mail mit Markierung der wichtigsten Bereiche

Archivierung apache logs

sfx4_clean_apache
#!/bin/bash
#delete old apache logs for all instances
 
#variables
backupDate=`date '+%d%b%y'`
logInstances=("sfx_basel41" "sfx_bern41" "sfx_hsg41" "sfx_ilu41" "sfx_uzh41" "sfx_zbz41" "sfxlcl41")
 
/etc/init.d/sfxd stop
 
for instance in "${logInstances[@]}"
do
        cd /exlibris/sfx_ver/sfx4_1/$instance/logs/apache
        cp access_log access_log.$backupDate
        cp error_log error_log.$backupDate
        rm access_log
        rm error_log
        touch access_log
        chown $instance.sfx access_log
        touch error_log
        chown $instance.sfx error_log
 
        /usr/bin/bzip2 -z9 access_log.$backupDate
        /usr/bin/bzip2 -z9 error_log.$backupDate
 
        find -mtime +90 -name 'access*bz2' -exec rm -f {} \;
        find -mtime +90 -name 'error*bz2' -exec rm -f {} \;
done
 
cd /exlibris/sfx_ver/sfx4_1/proxy/logs/
 
cp access_log access_log.$backupDate
cp error_log error_log.$backupDate
rm access_log
rm error_log
touch access_log
chown sfxglb41.sfx access_log
touch error_log
chown sfxglb41.sfx error_log
 
/usr/bin/bzip2 -z9 access_log.$backupDate
/usr/bin/bzip2 -z9 error_log.$backupDate
 
find -mtime +90 -name 'access*bz2' -exec rm -f {} \;
find -mtime +90 -name 'error*bz2' -exec rm -f {} \;
 
/etc/init.d/sfxd start
 
exit
root cronjob
50 4 1 * * /usr/local/bin/meta4_clean_apache_logs 1> /dev/null 2> /dev/null

Check for large files in SFX4

findlargefiles.sh
#!/bin/bash
# File: findlargefiles.sh
# sends list of large files in /exlibris/sfx_ver/sfx4_1/
#
# Lars Haender - 21/04/2011
#
find /exlibris/sfx_ver/sfx4_1/ -size +100000k -exec ls -alph {} \; | mailx -s "Server Report - large SFX4 files" ids@hbz.uzh.ch
exit 0
root cronjob
0 4 1 * * /exlibris/sfx_ver/sfx4_1/cleanupjobs/findlargefiles.sh 1> /dev/null 2> /dev/null