[CentOS] Run cornjobs only when a user is logged

Tue Jan 5 12:36:52 UTC 2016
Richard <lists-centos at listmail.innovate.net>


------------ Original Message ------------
> Date: Tuesday, January 05, 2016 11:26:01 +0000
> From: "C.L. Martinez" <carlopmart at gmail.com>
>
> Hi all,
> 
>   Is it possible to run cronjobs configured by a user to run only
> when he/she is logged (via GDM/KDM,etc.)?
> 

Seems a little antithetical, so you may want to provide more details
on what the issues are and what you are trying to accomplish. 

That said, the cron job being run could include a bit of code at the
top to check the user's logged in status and run or abort
accordingly.

A different approach would be to use cron.deny to keep a user from
setting up cron jobs, and instead have "at" jobs spawned when the
user logs in.