Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Add PATH variable to crontab

Jason Brown shared this idea 4 years ago
Not Planned

As a user of the cPanel interface, I would like the "Add New Cron Job" feature to add the user's current PATH variable to the crontab so that the exact link to binaries do not need to be called.


Currently, by default, if you add a cronjob, the only PATH used is the following:

 /usr/bin:/bin

This causes crons dependent on binaries and scripts that aren't in these locations to require the full path.


An example of a typical user's PATH would be this:

/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/home/user/.local/bin:/home/user/bin

Implementing this change would allow users to set "git" as the cron command rather than /usr/local/cpanel/3rdparty/lib/path-bin/git

Replies (1)

photo
1

Howdy,

Wanting to get a bit more information on this to better understand the issue. Are you currently updating your PATH in bashrc?


Dustin Scherer (he/him) | Product Owner | @dustinscherer

photo
1

Howdy back,


It's possible that the PATH was updated in .bashrc in my example (user/.local/bin does not appear in cpanel defaults), but I think the mvp would be at least the PATH that users have by default from /etc/bashrc if not considering customized paths.

photo
1

Thanks Jason! Going to mark this not planned for now, but we'll update this when it finds its way onto the roadmap.


Dustin Scherer (he/him) | Product Owner | @dustinscherer

photo
Leave a Comment
 
Attach a file