-
-
Save neoice/c482659253b187ad91ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# explicit PATH declaration per job | |
# works as intended | |
root@test1:~# crontab -l | |
PATH=/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/usr/ruby/2.1.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin | |
* * * * * env >> /tmp/e1 | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
* * * * * env >> /tmp/e2 | |
root@test1:~# cat /tmp/e1 | |
SHELL=/bin/sh | |
USER=root | |
PATH=/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/usr/ruby/2.1.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin | |
PWD=/root | |
LANG=en_US.UTF-8 | |
SHLVL=1 | |
HOME=/root | |
LOGNAME=root | |
_=/bin/env | |
root@test1:~# cat /tmp/e2 | |
SHELL=/bin/sh | |
USER=root | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
PWD=/root | |
LANG=en_US.UTF-8 | |
SHLVL=1 | |
HOME=/root | |
LOGNAME=root | |
_=/bin/env | |
# PATH declaration for first job but not second | |
# does not work: PATH is implicitly assumed for second job | |
root@-test1:~# crontab -l | |
PATH=/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/usr/ruby/2.1.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin | |
* * * * * env >> /tmp/e1 | |
* * * * * env >> /tmp/e2 | |
root@-test1:~# cat /tmp/e1 | |
SHELL=/bin/sh | |
USER=root | |
PATH=/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/usr/ruby/2.1.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin | |
PWD=/root | |
LANG=en_US.UTF-8 | |
SHLVL=1 | |
HOME=/root | |
LOGNAME=root | |
_=/bin/env | |
root@-test1:~# cat /tmp/e2 | |
SHELL=/bin/sh | |
USER=root | |
PATH=/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/opt/puppet/bin:/usr/ruby/2.1.2/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin | |
PWD=/root | |
LANG=en_US.UTF-8 | |
SHLVL=1 | |
HOME=/root | |
LOGNAME=root | |
_=/bin/env | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment