LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Run Script on GDM Logout? (https://www.linuxquestions.org/questions/linux-desktop-74/run-script-on-gdm-logout-634678/)

'58LesPaul 04-11-2008 10:07 AM

Run Script on GDM Logout?
 
OS: Ubuntu 7.10

Hello,

I am looking for a way to run an rsync backup script when a user logs out of gnome. Is it possible?

I've searched the web and found some suggestions like:

put it in ".bash_logout", which unfortunately only works if you are using a shell and log out of the shell.

Also, I've seen something about K scripts in init.d but I can't make heads or tails of that.

Is there an EASY way to run a simple shell script every time someone logs out of Gnome or shuts down the computer?

Thanks
LP

unSpawn 04-11-2008 11:05 AM

Could run a /etc/X11/gdm/PostSession/* script. See http://www.linuxquestions.org/questi...rsions-631968/ (different question, same solution).

'58LesPaul 04-11-2008 05:04 PM

Quote:

Originally Posted by unSpawn (Post 3118110)
Could run a /etc/X11/gdm/PostSession/* script. See http://www.linuxquestions.org/questi...rsions-631968/ (different question, same solution).

Thanks for the reply... I've checked out the "etc/gdm/PostSession" directory and it contains a "Default" shell script. Do I just add my rsync script to the "PostSession" directory or do I modify the "Default" script by adding my code to it?

Thanks!

jailbait 04-11-2008 05:21 PM

Quote:

Originally Posted by '58LesPaul (Post 3118433)

Do I just add my rsync script to the "PostSession" directory or do I modify the "Default" script by adding my code to it?

Thanks!

I would put your script somewhere where it won't be lost during reinstalls and then add a single line command which executes your script to the Default shell script. You will probably have to add the single line command to the Default script after every reinstall.

---------------------
Steve Stites

'58LesPaul 04-11-2008 09:13 PM

Quote:

Originally Posted by jailbait (Post 3118452)
I would put your script somewhere where it won't be lost during reinstalls and then add a single line command which executes your script to the Default shell script. You will probably have to add the single line command to the Default script after every reinstall.

---------------------
Steve Stites


Thanks very much for the help! I'll give it a try.

LP


All times are GMT -5. The time now is 12:49 PM.