#!/bin/bash # missa v.0.1 # copyright (c) 2000 by Jaume Teixi # You are free to distribute this software under # the terms of the GNU General Public License. tom_day=`date -d"tomorrow" +%d` if [ ${tom_day} -eq 1 ]; then if [ -s /var/oldlgs ] then echo "dir oldlgs exist"; else mkdir /var/oldlgs; fi if [ -s /var/archlgs ] then echo "dir archlgs exist"; else mkdir /var/archlgs; fi /etc/rmagic/missa_clients > /var/log/missa_clients.log /etc/rmagic/missa_ours > /var/log/missa_ours.log /etc/rmagic/missa_total > /var/log/missa_total.log datadir=`date +%Y-%m`; mkdir /var/archlgs/$datadir; mkdir /var/archlgs/$datadir/our_domains; mv /var/oldlgs/* /var/archlgs/$datadir; echo "today is last day of month and stadistics has been generated"; else echo "today still isn't last day of the month"; fi exit;