[kdepim-users] Seperate 'sets' of mail boxes
Ingo Klöcker
kloecker at kde.org
Mon Nov 24 19:41:52 GMT 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20081124/07a5684d/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM users mailing list
kdepim-users at kde.org
https://mail.kde.org/mailman/listinfo/kdepim-users
More information about the kdepim-users
mailing list