Re: kmail vs amanda problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 18 December 2020 04:35:09 deloptes via tde-users wrote:

> Gene Heskett via tde-users wrote:
> > Is there a dbus command my amanda script can send to tell amanda to
> > hold off expiry till amanda is done?
> >
> > Might be over an hour of expiry holdoff needed at times.
>
> Hi Gene,
> don't know about Amanda and dbus, but the best way to do a backup
> (nowdays) is to make a snapshot of the LVM and do the backup from the
> snapshot. You have to have some spare space - for the snapshot to
> work. I am planning myself to start doing this at home next year - but
> I need to do the calculations first and probably add/replace some
> disks.
> I am excited of how this works in production (the backup solution I
> worked with is proprietary one). It does backup VMs and DBs while they
> are operating and total disk space backuped is in TBs.
> Keep in mind: (as we usually say) it is not only the making of the
> backup, but the ability to restore.
>
> BTW kmail does not know dbus (AFAIK)
>
> regards
>
you are correct, it switched to dcop long bedfore the tde fork.

I've been using it to synchronize kmail to incoming mail 
for a very loooonngg time, with this script:

#!/bin/bash
# set -x
# this was a test, was /bin/sh above, but /bin/sh is a softlink to /bin/dash
# REQUIRES your distros inotify-tools package, assume kde/kmail in use
# but might be adaptable to other agents too
# requires a ~/log directory, so mkdir it before running it
# you will also need to either do the housekeeping of this file, or
# figure out how to make logrotate do it for you.
# which I did, long ago...

WatchDir=/var/spool/mail/

# Setup temporary log
Log=mail.log
# put it in my home dir like fetchmail and procmail
Mlog=~/log
# in case it doesn't exist, make it
touch ${Mlog}/${Log}
# the command to send over dbus/dcop to make kmail pull the mailfile
# in /var/spool/mail

# First set method
Method=dcop
if [[ ${Method} = 'dbus' ]]
then
        Cmd="/usr/bin/qdbus org.kde.kmail /KMail org.kde.kmail.kmail.checkMail"
fi
if [[ ${Method} = 'dcop' ]]
then
# or for dcop, use:
        Cmd="/opt/trinity/bin/dcop kmail KMailIface checkMail"
fi

#  Now, do forever
while :
do
        sleep 1
        if [ $(pidof -s kmail) ]
        then
                echo -n "Kmail is running " >>${Mlog}/${Log}
                date -R >>${Mlog}/${Log}
                sleep 1 # delay to give kmail a chance to settle in
                # only start fetchmail once!
                if [ $(pidof -s fetchmail) ]
                then
                        sleep 1
                        echo -n "fetchmail already running " >>${Mlog}/${Log}
                        date -R >>${Mlog}/${Log}

                else
                        echo -n "starting fetchmail at " >>${Mlog}/${Log}
                        /usr/local/bin/fetchmail --fetchmailrc /home/gene/.fetchmailrc >>${Mlog}/${Log} &
                        date -R >>${Mlog}/${Log}
                fi
                sleep 1 # delay to give kmail a chance to get its dcop/dbus sockets setup?
                $cmd
                while [ $(pidof -s kmail) ]
                do
                        # I've found that stderr needs dumped to /dev/null, so
                        InMail=`/usr/bin/inotifywait -q -e close_write --format %f ${WatchDir}` # 2>&1 >/dev/null
                        # and here it sits until inotifywait exits because of an incoming mail
                        # and time later it will exit, setting $InMail to something, so
                        # recheck to make sure kmail is still about before sending the signal
                        # as dbus/dcop seems to get a tummy ache if there is no receiver

                        if test "${InMail}" = "gene"
                        then
                                $Cmd
#                               sleep 1
                                # log it
                                echo -n ${InMail} >>${Mlog}/${Log}
                                echo -n " @ " >>${Mlog}/${Log}
                                date -R >>${Mlog}/${Log}
                        elif test "${InMail}" = "gene-from_linda"
                        then
                                $Cmd
#                               sleep 1
                                # log it
                                echo -n ${InMail} >>${Mlog}/${Log}
                                echo -n " @ " >>${Mlog}/${Log}
                                date -R >>${Mlog}/${Log}
                        elif test "${InMail}" = "amanda"
                        then
                                $Cmd
#                               sleep 1
                                # log it
                                echo -n ${InMail} >>${Mlog}/${Log}
                                echo -n " @ " >>${Mlog}/${Log}
                                date -R >>${Mlog}/${Log}
                        fi

                done
                # we don't have a pidof kmail, log that its gone
                echo -n "Kmails pid is missing - it has stopped ">>${Mlog}/${Log}
                date -R >>${Mlog}/${Log}
                # Now, kill fetchmail too, and this is ok to do
                killall fetchmail
                # get rid of a waiting inotifywait, but this is not inotifywait instance
                # sensitive and may kill the one for cocoprint.
                killall inotifywait
        fi
        # and should be back in the outer loop, waiting for a kmail PID
done
===============================

fetchmail runs in a 2 minute loop, hands incoming mail off to procmail,
which runs it thru quite a few deaths and diversions including clamav,
spamassassin, and puts the survivors in /var/spool/mail/$name. inotifywait
watch that dir, exists with the $name & this file tells kmail to go get 
the mail and sort it to where it goes.  I'm a lazy old fart, all I have 
to do is hit the + key to read the next message, if I can help hit the
type of reply, when done hit ctrl+return then the + key for the next
unread msg. Computers should do the work, that's what they are good at.
Make them do all the damned drudgery and mindless crap.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> trinity-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx For additional
> commands, e-mail: trinity-users-help@xxxxxxxxxxxxxxxxxxxxxxxxxx Read
> list messages on the web archive:
> http://trinity-users.pearsoncomputing.net/ Please remember not to
> top-post:
> http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
> ____________________________________________________
> tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx
> Web mail archive available at
> https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@trinity
>desktop.org


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
____________________________________________________
tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx
Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@xxxxxxxxxxxxxxxxxx



[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux