1752781 Members
6102 Online
108789 Solutions
New Discussion юеВ

non-root cronjobs

 
SOLVED
Go to solution
Shivkumar
Super Advisor

non-root cronjobs

Dear Sirs,

What is command to find out cronjobs run by all non-root users ?

Thanks,
Shiv
5 REPLIES 5
Devesh Pant_1
Esteemed Contributor
Solution

Re: non-root cronjobs

Shiv,
you can do the following

ls -la /var/spool/cron/crontabs/*

and that will list the crontabs for each of the users
You as root can view each one of these files.
One other way is

for each in `ls /var/spool/cron/crontabs/*`
do
cat $each
done

This will list all the contents in each file for all the crontabs

thanks
DP
Michael Schulte zur Sur
Honored Contributor

Re: non-root cronjobs

Hi,

but only those files that relate to an existing user are executed.

Michael
Mahesh Kumar Malik
Honored Contributor

Re: non-root cronjobs

Hi Shiv

Following info may be useful

/var/adm/cron Main cron directory

/var/spool/cron/atjobs
Directory containing at and batch job files

/var/spool/cron/crontabs
Directory containing crontab files

/var/adm/cron/log
Accounting information

Regards
Mahesh

Eknath
Trusted Contributor

Re: non-root cronjobs

Hi Shiv,

/var/spool/cron/crontabs/ is the directory where each users cronjobs are specified by the username. These are ASCII files which can be viewed.

Secondly if you want to find out for perticular user give #crontab -l username which will list users crontab file

Cheers !!!
eknath
Cem Tugrul
Esteemed Contributor

Re: non-root cronjobs

Hi Shiv,

As an addition to other replies if you
want to give permission to a non_root user
who may want to use cron then just add this
user to the file;

/var/adm/cron/cron.allow

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't