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

3 Replies

Hello,

from man:

> 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

Special note: both the symlink itself and the target must be owned by root.

Thank you very much; it solves my problem

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct