Operating System - Linux
1827399 Members
4811 Online
109965 Solutions
New Discussion

is this crontab config possible?...

 
K.C. Chan
Trusted Contributor

is this crontab config possible?...

I have cron entries for various which runs under one account. I was thinking of braking this entries into modular component, each app has its own cron file. On the main crontab file, it reference this individual cronfile. Is this possible? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
3 REPLIES 3
Chan 007
Honored Contributor

Re: is this crontab config possible?...

Chan,

You can run all cron jobs from root. All you have to do is, just a wrapper script,

which does

su - username and then kicks it off.

Else, as told you can have for each user wise,

Chan
Ivan Ferreira
Honored Contributor

Re: is this crontab config possible?...

If you want to do some modular configuration, you can take the example of the /etc/crontab file, which uses run-parts to run scripts located in a specific directory.

Just change the line to run the scripts in the directories as the user you want, at the time you want, for example:

0 0 * * * username run-parts /etc/cron.d/username.d/
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Stuart Browne
Honored Contributor

Re: is this crontab config possible?...

The other thing you can do on modern Linux distributions (you're using RHEL from memory, so that's fine) is to use the '/etc/cron.d/' structure, and pop individual crontabs in there for your different appliations.

These appear similr to the '/etc/crontab' file (i.e. they have the user-to-run-as listed as the 6th argument).

One long-haired git at your service...