I use Ubuntu 10.10, and I have a Python program (Mnemosyne) that I synchronize the data files using Dropbox. Here is my problem scenario. I leave the program running at home and go to work, but if I open the program at work and work on it the data file is changed, and I loose my progress at home when I exit (it automatically saves) when exiting.
I thought I could create a cron job to automatically close Mnemosyne every morning regardless of me remembering to do it or not, but if I use kill the program it exits without saving the datafile, and I end up with a tmp file and an error message when I restart it. Is there a better way of sending the exit signal to this program emulating me clicking file>exit menu option.
kill <program name>
?kill - 15 appNameHere
should send it theSIGTERM
signal, which, if I remember right, asks to program to terminate itself. If it is well behaved, it should execute it's normal cleanup/save routines before exiting.