Should linux cron jobs be specified with an "&" to indicate to run in background?

LinuxCron

Linux Problem Overview


In a crontab file, should commands be specified with a trailing "&", or will the command run in the background anyway?

I have:

*/20 * * * * /home/me/monitor/check.sh /home/me/monitor/check.properties  >> /home/me/monitor/check.log 2>&1 &

I've seen contradictory answers to this question in various places. Some say no need to put an "&", others that without the ampersand cron waits for output from the command, even though all output is redirected.

Linux Solutions


Solution 1 - Linux

Every job that's run by cron is run in the background automatically, so no need for the &

See this too.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser265330View Question on Stackoverflow
Solution 1 - LinuxLevonView Answer on Stackoverflow