Expect script does not work under crontab

后端 未结 4 953
挽巷
挽巷 2020-12-29 08:22

I have an expect script which I need to run every 3 mins on my management node to collect tx/rx values for each port attached to DCX Brocade SAN Switch usin

4条回答
  •  渐次进展
    2020-12-29 08:39

    Jobs run by cron are not considered login shells, and thus don't source your .bashrc, .bash_profile, etc.

    If you want that behavior, you need to add it explicitly to the crontab entry like so:

    $ crontab -l
    0 13 * * * bash -c '. .bash_profile; etc ...'
    $
    

提交回复
热议问题