🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.os.linux.debian
Article #29313

Re: backup obraz

#29313
From: LeadMan
Date: Thu, 18 Oct 2007 11:23
82 lines
3912 bytes
Dnia Thu, 18 Oct 2007 11:51:24 +0200, Maciej Milaszewski napisał(a):

> Witam
> No ciekawe ciekawe :) maz moze jakiegos prostego confa o tego itp ? Bo
> bym sobie z checia potestowal a ostatnio mam malo czasu zeby zaglebiac
> sie teraz w dokumentacje itp.
Do tego nie mam konfa - opcje idą z lini komend. Ale jeżeli cię to
interesuje to poniżej masz skrypt który do tego wykorzystuję. P.S.Czy
"PAN" potrafi załączyć plik do postu na grupie?
P.P.S.Dalej nie zawijam wierszy, żeby się łatwiej czytało.

glpi:/usr/local/mondo# glpi:/usr/local/mondo# cat mondo.sh
#!/bin/sh
#
# Made by LeadMan 2006
#
# Stopping servers, to avoid corrupting of database,etc:
clear
for service in snmpd vsftpd apache2 mysql exim4 inetd apcupsd
do
    echo '[mondo.sh '`date "+%F %T"`'] Stopping '$service' service.' > /var/log/mondo.sh.log
    service $service stop
    service_exit_status=$?
    sleep 8
    counter=0
    while [ $counter -lt 3 ]
    do
        sleep 12
        ps ax | grep $service | grep -v grep
        if [ $? -eq 0 ]
        then
            echo '[mondo.sh '`date "+%F %T"`'] Failed stopping '$service' service (service returned status '$service_exit_status'), trying again...' >> /var/log/mondo.sh.log
            counter=$[ counter + 1 ]
            service $service stop
        else
            echo '[mondo.sh '`date "+%F %T"`'] Service '$service' stopped.' >> /var/log/mondo.sh.log
            counter=3
        fi
    done
done
# Making backup:
mondoarchive -ONFre9 -p glpi -d /dev/cdrom -s 4380m 2>&1 >> /var/log/mondo.sh.log
if [ $? -eq 0 ]
then
    echo '[mondo.sh '`date "+%F %T"`'] DVD backup succedded.(?) Insert new blank DVD.' >> /var/log/mondo.sh.log
    eject
else
    echo '[mondo.sh '`date "+%F %T"`'] DVD backup FAILED.' >> /var/log/mondo.sh.log
    # Place for some function that would notify admin by sms/mail/etc
fi
# Starting servers
for service in apcupsd inetd exim4 mysql apache2 vsftpd snmpd
do
    echo '[mondo.sh '`date "+%F %T"`'] Starting '$service' service.' >> /var/log/mondo.sh.log
    service $service start
    service_exit_status=$?
    sleep 8
    counter=0
    while [ $counter -lt 3 ]
    do
        sleep 12
        ps ax | grep $service | grep -v grep
        if [ $? -ne 0 ]
        then
            echo '[mondo.sh '`date "+%F %T"`'] Failed starting '$service' service (service returned status '$service_exit_status'), trying again...' >> /var/log/mondo.sh.log
            counter=$[ counter + 1 ]
            service $service start
        else
            echo '[mondo.sh '`date "+%F %T"`'] Service '$service' started.' >> /var/log/mondo.sh.log
            counter=3
        fi
    done
done
exit 0



-- 
Kind Regards,          Patryk Benderz,  Linux Registered User #377521

 "...if something can go wrong, it will, except of a prototype, where if
 it can go right, it will..." - Engineer's Law.
Technical Details
Message-ID: <ff7fnr$2kh$2@news.telbank.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.telbank.pl!not-for-mail
References: <op.ty1uxejwsa0ju1@linux.sbsmen.edu.pl> <fd7tpf$srg$1@news.telbank.pl> <fevg12$spl$2@news2.task.gda.pl> <ff1pl5$lnj$1@news.telbank.pl> <ff4brq$g2m$1@news2.task.gda.pl> <ff574n$r7u$2@news.telbank.pl> <ff7a0a$b9i$3@news2.task.gda.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.telbank.pl!not-for-mail
From: LeadMan <kit.na.harvestery@lokalhost.pl>
Newsgroups: alt.pl.comp.os.linux.debian
Subject: Re: backup obraz
Date: 18 Oct 2007 11:23:39 GMT
Organization: BPTNet - http://www.telbank.pl
Lines: 82
Message-ID: <ff7fnr$2kh$2@news.telbank.pl>
References: <op.ty1uxejwsa0ju1@linux.sbsmen.edu.pl> <fd7tpf$srg$1@news.telbank.pl> <fevg12$spl$2@news2.task.gda.pl> <ff1pl5$lnj$1@news.telbank.pl> <ff4brq$g2m$1@news2.task.gda.pl> <ff574n$r7u$2@news.telbank.pl> <ff7a0a$b9i$3@news2.task.gda.pl>
Reply-To: "LeadMan" <leadman@esp.pl>
NNTP-Posting-Host: 82.177.11.56
Mime-Version: 1.0
X-Trace: news.telbank.pl 1192706619 2705 82.177.11.56 (18 Oct 2007 11:23:39 GMT)
X-Complaints-To: usenet@news.telbank.pl
NNTP-Posting-Date: 18 Oct 2007 11:23:39 GMT
User-Agent: pan 0.120 (Plate of Shrimp)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit