From owner-freebsd-questions@FreeBSD.ORG Tue Oct 11 14:28:13 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 8E523106564A for ; Tue, 11 Oct 2011 14:28:13 +0000 (UTC) (envelope-from feenberg@nber.org) Received: from mail2.nber.org (mail2.nber.org [66.251.72.79]) by mx1.freebsd.org (Postfix) with ESMTP id 28FB28FC0A for ; Tue, 11 Oct 2011 14:28:12 +0000 (UTC) Received: from nber6.nber.org (nber6.nber.org [66.251.72.76]) by mail2.nber.org (8.14.4/8.14.4) with ESMTP id p9BES8gk087562; Tue, 11 Oct 2011 10:28:08 -0400 (EDT) (envelope-from feenberg@nber.org) Received: from localhost (feenberg@localhost) by nber6.nber.org (8.14.4/8.14.4/Submit) with ESMTP id p9BERDm6027246; Tue, 11 Oct 2011 10:27:19 -0400 (EDT) X-Authentication-Warning: nber6.nber.org: feenberg owned process doing -bs Date: Tue, 11 Oct 2011 10:27:13 -0400 (EDT) From: Daniel Feenberg X-X-Sender: feenberg@nber6 To: Polytropon In-Reply-To: <20111011155750.2f70109d.freebsd@edvax.de> Message-ID: References: <20111011155750.2f70109d.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Anti-Virus: Kaspersky Anti-Virus for Linux Mail Server 5.6.39/RELEASE, bases: 20111011 #5530008, check: 20111011 clean Cc: FreeBSD Questions Subject: Re: User tasks in ~/.logout X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 14:28:13 -0000 On Tue, 11 Oct 2011, Polytropon wrote: > 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. > If the user doesn't want to wait for the script to complete for the session to end, you could start the script with a call to "batch" or "at". The shell documentation claims that .logout executes whenever the shell exits, so your script should execute even if the user neglects to properly log out, however I haven't experimented with that. Are you sure you wouldn't be better off with a cron job? Is it that you don't want the script running while the user is logged in? Dan Feenberg