need to run shell script at gdm log out

Mike lake.wind77 at gmail.com
Sat Apr 5 12:18:16 EDT 2008


David Kramer wrote:
> Mike wrote:
>> I'm looking for a way to run a shell script automatically every time a 
>> user logs out of Gnome or attempts to shut down the computer. Is this 
>> possible?
>>
>> What I'm trying to do is to back up the users home directory to a back 
>> up directory on a server, every time the user initiates a shut down.
> 
> That's easy, though the exaxt details depend on your OS.  Just use the 
> /etc/init.d subsystem to make a K script for runlevel 5 (on my OS, that 
> would mean putting a script in /etc/rc.d/rc5.d/ starting with a K. 
> Whenever you exit X and return to runlevel 3 (or shut down), that script 
> will be run,
> 
> THere's also ~/.bash_logout
> 
> 

Thanks for the info. This sounds just like what I need. I'll 
give it a try.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Discuss mailing list