User tasks in ~/.logout
Daniel Feenberg
feenberg at nber.org
Tue Oct 11 14:28:13 UTC 2011
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
More information about the freebsd-questions
mailing list