Re: [Evolution] Evolution not listening to quit

On Sun, 2019-06-02 at 09:14 +0100, Michelle via evolution-list wrote:
Upgraded my version of Mint, which has...
Evolution 3.28.5-0ubuntu0.18.04.1

Prior to upgrading Linux Mint, my evolution backup script contained

export DISPLAY=:0.0
rm /mnt/tank/users/michelle/backup/mail/5.tar.gz
mv /mnt/tank/users/michelle/backup/mail/4.tar.gz
mv /mnt/tank/users/michelle/backup/mail/3.tar.gz
mv /mnt/tank/users/michelle/backup/mail/2.tar.gz
mv /mnt/tank/users/michelle/backup/mail/1.tar.gz
sleep 5
cd ~
/usr/lib/evolution/evolution-backup --restart --backup

It is set to run three times a week and needed the export command to
get the shutdown to occur.

However, on those occasions I am now waking up after the overnight
backup, to find two copies of Evolution running. With or without the
display export.

The results form the script are as follows...

michelle@main-desktop:~$ ./ 
evolution-backup-Message: 09:05:55.487: evolution --quit
evolution-backup-Message: 09:05:55.886: rm
rm: cannot remove '/home/michelle/.local/share/evolution/.running': No
such file or directory
evolution-backup-Message: 09:05:55.888: dconf dump
evolution-backup-Message: 09:05:55.892: dconf dump
/org/gnome/evolution/ >/home/michelle/.local/share/evolution/backup-
evolution-backup-Message: 09:05:55.908: cd /home/michelle && tar chf -
.local/share/evolution .config/evolution evolution.dir | gzip >
tar: .local/share/evolution: file changed as we read it
evolution-backup-Message: 09:08:07.003: rm

So evolution-backup is reporting the "quit" to evolution, but it
doesn't appear to be listening. Also, there never appears to be a
.running file in .local so I'm not sure what's happening.

I've tried dropping to a command prompt and just issuing...
evolution --quit

... but it doesn't respond and stays running.

Any advice please?


my advice is to think over your strategy of doing a backup.

You are executing one command after the other, without even checking the
exit status of a command, before you execute the next command. You try
to remove '.local/share/evolution/.running', a file that doesn't exist.
However, if such a file would exist, you probably would work against the
purpose of the file, by just removing it, let alone that if the file
would exist and if it would make sense to remove the file, you still
don't test, if the file was removed successfully. After executing a
command, you at least should redirect the output of "echo $?" to a log
file or better let the script do something smart. However, without a
smart script and without a log file, at least use '&&' between commands,
so if the exit status shouldn't be 0, the next command wouldn't be

Even '#!/bin/sh' already could cause issues, since it not necessarily is
a link against the shell you expect.

I wonder what kind of setup requires to export DISPLAY?

Do you run a bunch of similar scripts, that don't know about the other

Btw. if you post code, consider to use Evolution's plain text editor option "Preformatted" to avoid line 
wrapping ;) or add the code as an attachment or at least add a '\' before a line is wrapped.

I run a lot of unimportant scripts with a 'sleep n' for liely the reason
you add it to your script, but I never ever would use this for an
important backup script. Btw. what do you gain from 'sleep' here? I
guess a command followed by 'mv' won't run, before 'mv' finished, unless
you are using '&'. It still would be better to use '&&' to ensure that
'mv' not only finished, but finished successfully.

Just my 2 Cents,

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