Afficher un message
Vieux 27/03/2008, 00h45   #7
Andrew Smallshaw
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Running script after logging out of SSH

On 2008-03-26, laredotornado <laredotornado@zipmail.com> wrote:
> On Mar 24, 6:16pm, Luuk <L...@invalid.lan> wrote:
>>
>> type:
>> $ man zsh
>>
>> and search for 'logout'
>> (by typeing '/logout'...)
>> you'll find the info there
>>
>> --
>> Luuk

>
> So the file is ~/.zlogout. Thanks to the group for that one. Here's
> a follow up. My .zlogout file consists of
>
> nohup sh /opt/scripts/backup_web.sh
>
> As I said, I'm logged in through PuTTy on Windows XP, but when I exit,
> like below, the window doesn't close, instead it just hangs on the
> last line:
>
> [me@mymachine]/opt/scripts% exit
> nohup: appending output to `/home/me/nohup.out'


You need an ampersand after the nohup command:

nohup sh /opt/scripts/backup_web.sh &

I missed the beginning of this thread so I don't know if you were
using zsh anyway. You can do the same thing with any sh compatible
shell via the trap command in the login shell (e.g. via .profile):

trap "/command/to/execute -options" 0


--
Andrew Smallshaw
andrews@sdf.lonestar.org
  Réponse avec citation
 
Page generated in 0,05648 seconds with 9 queries