Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


several crontab files

Click here to go to the original topic

 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum
Author Message
jcr



Joined: 14 May 2007
Posts: 39

Posted: Wed Jul 23, 2008 3:24 am    Post subject: several crontab files  

Hello.
I am using the /etc/crontab files and it works well.
I'd like to add the content of the file located at
/test/crontab
to each time cron runs.

Is there a way to register that /test/crontab? Should I add a special line to the /etc/crontab to call a the /test/crontab file as well? I am not sure what to do and I don't want to break anything.

Thank you
Back to top  
petrh



Joined: 23 Jul 2008
Posts: 1

Posted: Wed Jul 23, 2008 7:55 am    Post subject:  

Hello,

from man:

Quote: cron also reads /etc/crontab, which is in a slightly different format (see crontab(5)). Additionally, cron reads the files in /etc/cron.d: it treats the files in /etc/cron.d as in the same way as the /etc/crontab file (they follow the special format of that file, i.e. they include the user field).

So you can:
1. place your other crontabs to /etc/cron.d
2. symlink /test/crontab to /etc/cron.d/, for ex. ln -s /test/crontab /etc/cron.d/mynewcrontab

Petr
Back to top  
SteveG



Joined: 30 Nov 2003
Posts: 212

Posted: Wed Jul 23, 2008 10:28 am    Post subject:  

Special note: both the symlink itself and the target must be owned by root.
Back to top  
jcr



Joined: 14 May 2007
Posts: 39

Posted: Sat Jul 26, 2008 12:40 pm    Post subject:  

Thank you very much; it solves my problem
Back to top  
 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum
Page 1 of 1