Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 082010
 

What does the run-parts mean in crontab?

Answer:

You might find the following lines in /etc/crontab

01 * * * * root run-parts /etc/cron.hourly

The actual meaning of run-parts is to run all the scripts in a given directory. So the above hourly cron means to execute all the scripts in the directory /etc/cron.hourly every hour.

See:

man run-parts

Jan 072010
 

Meaning of 2>&1 in crontab

Answer:

It is quite common to find the following line in crontab

32 5 * * * root /project/cron.sh >> /dev/null 2>&1

The meaning of 2>&1 at the end of line means to redirect the standard error stream (stderr) to the standard out stream (stdout), and finally redirect everything to /dev/null.

It is commonly used in crontab definition so if a given command return too much warnings, it will not be logged anywhere in the system in order to reduce the storage requirements.