Skip to content
Snippets Groups Projects
Commit 46285adb authored by srosse's avatar srosse
Browse files

Merge with d73545f219a232224e3ffc411c93234b0784662e

parents 3625b1b6 711242ac
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
## counts unique logins out of one or more olat log files.
## Usage: count-unique-users.sh filename1 filename2 ...
for l in `ls $1`
do
awk 'BEGIN{FS="\\^%\\^"}/Logged.on/{split($1,tmp," ");start=index($9,"[");end=index($9,"]");msg=substr($9,start+1,end-start-1);print msg}' $l | sort -u | wc -l
echo $res
done
#!/bin/bash
#############################################################################
# Initial database setup script: will generate db user and an olat database #
# 11. July 2004 Florian Gngi #
# 11. July 2004 Florian Gnaegi #
#############################################################################
echo "This script will create a database user and a database for OLAT on your MySQL server. Do you want to continue? (y|n)"
......
#!/bin/sh
# Generates a disk usage report
# 19.11.2004
# gnaegi@id.unizh.ch
TOMAIL="olat@olat.unizh.ch"
FROMMAIL="id_olat@id.unizh.ch"
cd /usr/local/opt/olat/olatdata/
rm -f quota.txt
uname -a >> quota.txt
echo -e "-------------------------------------\n" >> quota.txt
echo -e "Disk Usage of olatdata directory" >> quota.txt
echo -e "-------------------------------------\n" >> quota.txt
du -hs --exclude=bcroot --exclude=quota.txt--exclude=quota.txt ??* >> quota.txt
du -h --max-depth=1 bcroot >> quota.txt
du -hs . >>quota.txt
echo -e "\n\nFilesystem Totals" >> quota.txt
echo -e "-------------------------------------\n" >> quota.txt
df -h >> quota.txt
echo -e "\n\nTop-10 space waster statistics (in MB)" >> quota.txt
echo -e "-------------------------------------\n" >> quota.txt
echo -e "Top 10 course folder:" >> quota.txt
du --block-size=1MB --max-depth=1 bcroot/course/ | sort -gr | head -n 11 | tail -n 10 >> quota.txt
echo -e "\nTop 10 user homes:" >> quota.txt
du --block-size=1MB --max-depth=1 bcroot/homes/ | sort -gr | head -n 11 | tail -n 10 >> quota.txt
echo -e "\nTop 10 group folders:" >> quota.txt
du --block-size=1MB --max-depth=1 bcroot/cts/folders/BusinessGroup/ | sort -gr | head -n 11 | tail -n 10 >> quota.txt
echo -e "\nTop 10 repository entries:" >> quota.txt
du --block-size=1MB --max-depth=1 bcroot/repository/ | sort -gr | head -n 11 | tail -n 10 >> quota.txt
less quota.txt 2>&1 | mail -s "Nightly OLAT disk usage report" -r $FROMMAIL $TOMAIL
#!/bin/sh
# zip rotated logs
cd /usr/local/opt/olat/olatdata/logs/
gzip -9 apache_access_log.txt.1
gzip -9 apache_error_log.txt.1
gzip -9 mod_jk.log.txt.1
gzip -9 monitoring_log.txt.1
# move rotated logs into archive folder
mv apache_access_log.txt.1.gz archive/apache_access_log.txt.$(date +"%Y%m%d").gz
mv apache_error_log.txt.1.gz archive/apache_error_log.txt.$(date +"%Y%m%d").gz
mv mod_jk.log.txt.1.gz archive/mod_jk.log.txt.$(date +"%Y%m%d").gz
mv monitoring_log.txt.1.gz archive/monitoring_log.txt.$(date +"%Y%m%d").gz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment