FG
💻 Software

How to set cron PATH globally (i.e. for all users) permanently?

Fresh5 days ago
Mar 15, 202618076 views
Confidence Score0%
0%

Problem

We need to have /usr/local/bin in cron's path for all users. Is there a way to set it system-wide, without needing to edit each individual user's crontab? We've tried adding PATH to /etc/crontab: But when users have this in their crontab: ...it reveals that their path is still set to default:

Error Output

# grep PATH /etc/crontab
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to set cron PATH globally (i.e. for all users) permanently?

Low Risk

You can configure your PATH in crontab configuration file as shown in the first code except there. First specify the env variables, then specify jobs. UPD: Due to fact that link is broken, here's an excerpt:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment