Re: Seperate 'sets' of mail boxes

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.users.pim
Message-ID <[email protected]>
On Friday 21 November 2008, Peter777 wrote:
> On Friday 21 November 2008 06:22:39 Ingo Klöcker wrote:
> > On Thursday 20 November 2008, Peter777 wrote:
> > > > You could do something like the following:
> > > > cp kmailrc_friends ~/.kde/share/config/kmailrc
> > > > kmail --nofork
> > > > cp ~/.kde/share/config/kmailrc kmailrc_friends
> > > >
> > > > You'd put those three lines in a bash script and create similar
> > > > files for your different configurations.
> > >
> > > Okay, thanks. That looks interesting. No doubt I'd possibly need
> > > to consider what to do in the event of KMail crashing, and the
> > > final 'cp' not being done.
> >
> > If KMail crashes (and thus exits), then the final 'cp' will be
> > done. The execution of the script will not be affect by KMail
> > crashing.
>
> Wouldn't that potentially corrupt kmailrc_friends ?  If KMail
> crashed, the config file it is using (kmailrc)  _probably_ wouldn't
> get updated correctly, fairly high chance of it being corrupted in a
> crash.
>
> Then if it (kmailrc_friends) was over-written with kmailrc (in a
> crash), and say some mail files/folders had been updated, the data
> may be out of sync with the config file.
>
> Possibly some way of not over writing kmailrc_friends in the event of
> a crash, and also restoring the data to what it was before the
> script/bash was run ??

The following should do the trick:

cp kmailrc_friends ~/.kde/share/config/kmailrc
kmail --nofork && cp ~/.kde/share/config/kmailrc kmailrc_friends


The '&&' ensures that the command after '&&' is executed if (and only 
if) the command before '&&' exitted successfully.


Regards,
Ingo

_______________________________________________
KDE PIM users mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kdepim-users
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEABECAAYFAkkrA4UACgkQGnR+RTDgudjqYwCfYRHQ4953Qj6jdo8gCcmLmpBe
2L8AoLOJE2DAFTLHL110cqSdj0q9q57k
=Z09d
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.