LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Crontab Question (https://www.linuxquestions.org/questions/linux-server-73/crontab-question-796895/)

psoheil 03-21-2010 01:40 PM

Crontab Question
 
Hello All,

I have a crontab related question which I am hoping someone can answer. I recently took over a Redhat Enterprise 5 Server, and I was told by the previous Server Admin that there is a cron job that does the backups. I ran the following command to get a list of all users:

Code:

cat /etc/passwd | grep "/home" |cut -d: -f1
I then ran the following command for each of those users to see if they have any crontabs associated with them:

Code:

crontab -u USER -l
It doesn't show any crontab entries for any users (including root). But I am positive that there is a scheduled job somewhere because the backups are still running every night.

What am I missing here? Any help would be much appreciated.

Thanks,
Pete

repo 03-21-2010 01:43 PM

Take a look in the
Code:

/etc/cron*
directories

psoheil 03-21-2010 01:54 PM

Quote:

Originally Posted by repo (Post 3906723)
Take a look in the
Code:

/etc/cron*
directories

Thank you very much for the quick response repo. I see the backup script in question in "/etc/cron.daily/sqlbackup". But it doesn't show under crontab. Does that mean the script file was manually created there?

Also, how do I find out what user the script executes under (is it the Owner user of the file)? Do any script files created in cron* folders automatically execute without entering crontab entry for them?

Thanks,
Pete

repo 03-21-2010 02:05 PM

Take a look at
http://www.debian-administration.org/articles/56
Best is to look at the script, to see what it does.
Files in cron.* are mostly executed as root, unless another user is setup in the script.

mario.almeida 03-21-2010 02:08 PM

Hi,

Check this file /etc/crontab

alunduil 03-21-2010 02:17 PM

I believe you're using vixie-cron which executes those directories as part of it's responsibilities without needing a system crontab.

Regards,

Alunduil

psoheil 03-21-2010 04:53 PM

Quote:

Originally Posted by repo (Post 3906738)
Take a look at
http://www.debian-administration.org/articles/56
Best is to look at the script, to see what it does.
Files in cron.* are mostly executed as root, unless another user is setup in the script.

Thank you very much. This line answers my question:

Quote:

Except for the first one which is special, these directories allow scheduling of system-wide jobs in a coarse manner. Any script which is executable and placed inside them will run at the frequency which its name suggests.


All times are GMT -5. The time now is 09:21 PM.