Re: run bash <filename> from cron

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 11/15/2017 11:57 AM, Paul Heinlein wrote:
In your crontab, try

  env PATH="$PATH:/root/bin" bash filename.txt

Maybe I wasn't terribly clear, for which I apologize.  I'm not running the text file itself from cron.  I'm running an ansible playbook from cron, which, as one of its tasks runs 'bash filename.txt'.  It's possible I could try the command you recommend above in the task and see if that fixes it.

However, I have another method that works in a similar fashion. I simply added BASH_ENV=$HOME/bash_profile to the top of my crontab, which has fixed the issue.  I could have sourced the profile on the cronjob line, but this is a bit clearer for other who might access the system.

--
Mark Haney
Network Engineer at NeoNova
919-460-3330 option 1
mark.haney@xxxxxxxxxxx
www.neonova.net

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux