If you're on linux/bsd/mac you can set some environment variables like PATH
right in the crontab
, and with that you're generally good to go.
If you're on Solaris, well, I pray for you. But, I do have an answer too: I generally source .profile
before running anything:
0 0 * * 0 . /home/myuser/.profile && cd /path && ./script
Mind you, my .profile
loads .bash_profile
and .bashrc
. Just be sure whatever file you source has what you need.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…