From owner-freebsd-questions@FreeBSD.ORG Tue Oct 11 13:57:52 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8DC1065670 for ; Tue, 11 Oct 2011 13:57:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 01BB88FC15 for ; Tue, 11 Oct 2011 13:57:51 +0000 (UTC) Received: from r56.edvax.de (port-92-195-41-66.dynamic.qsc.de [92.195.41.66]) by mx02.qsc.de (Postfix) with ESMTP id 7C8FB1E143 for ; Tue, 11 Oct 2011 15:57:50 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id p9BDvoZi001930 for ; Tue, 11 Oct 2011 15:57:50 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 11 Oct 2011 15:57:50 +0200 From: Polytropon To: FreeBSD Questions Message-Id: <20111011155750.2f70109d.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: User tasks in ~/.logout X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 13:57:52 -0000 I have some users who I want to "schedule" a specific job for which gets executed on their user account. For some of them, it will be twice a day, for others just once a month. It should happen at logout time. The intended mechanism to do so is ~/.logout, the C shell's logout script. Example: The user quits his work (shell "exit" or ending a custom program that is executed by the shell), now the ~/.logout shoult be executed, e. g. copying his current datasets to "immediate backup" (or other means of processing). I assume I cannot use this approach when the user runs his specific program _as_ the shell (per /etc/passwd), but that's not a problem now, as it's easier to give a regular shell and use ~/.login to "auto-exec" the user-specific program). My question is: As users connect to the system per SSH, how much time will the "at logout time" process have to finish work, or does it work _any_ time after the user has (1st) logged out and (2nd) terminated SSH connection (e. g. disconnect from SSH CLI client or PuTTY)? Will such a ~/.logout job finish even if the user closes his connection right after logout? And just in case a user does not properly log out (e. g. closes PuTTY right from the open session, maybe from within the program or shell he currently runs), will this cause ~/.logout to be processed, or will it be a "stale connection"? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...