LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-11-2008, 10:07 AM   #1
'58LesPaul
LQ Newbie
 
Registered: Apr 2008
Location: Chicago
Distribution: Ubuntu 7.10
Posts: 5

Rep: Reputation: 0
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
 
Old 04-11-2008, 11:05 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,409
Blog Entries: 55

Rep: Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582
Could run a /etc/X11/gdm/PostSession/* script. See http://www.linuxquestions.org/questi...rsions-631968/ (different question, same solution).
 
Old 04-11-2008, 05:04 PM   #3
'58LesPaul
LQ Newbie
 
Registered: Apr 2008
Location: Chicago
Distribution: Ubuntu 7.10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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!
 
Old 04-11-2008, 05:21 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by '58LesPaul View Post

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
 
Old 04-11-2008, 09:13 PM   #5
'58LesPaul
LQ Newbie
 
Registered: Apr 2008
Location: Chicago
Distribution: Ubuntu 7.10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jailbait View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script run as user login or logout in Vsftpd server singhpps Linux - Software 4 11-27-2010 11:06 AM
I need a script to run at user logout jr_linux Linux - Newbie 3 03-25-2008 02:41 PM
loginscript--run script-- logout sinister1 Linux - Security 6 01-16-2008 10:44 AM
would script run after logout? mokku Linux - Newbie 3 12-03-2007 11:21 AM
How to run a Script as root, after Login as User, in GDM MHOOO Red Hat 14 03-08-2005 08:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration