<html><head></head><body><div class="ydpfc6dc9ebyahoo-style-wrap" style="font-family: bookman old style, new york, times, serif; font-size: 16px;"><div id="ydpfc6dc9ebyiv6220149868" style=""><div class="ydpfc6dc9ebyiv6220149868ydp86a03a40yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><div style="font-size: 16px;"></div>
<div style="font-size: 16px;">Dear Yang,</div><div style="font-size: 16px;">I think add following lines above the bash file could solve the problem, if doesn't let me know:</div><div style="font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-size: 16px;"><div><div>export NCARG_ROOT=<span style="background-color: rgb(253, 239, 43);">/usr/local/ncl6.6</span></div><div>export PATH=$PATH:$NCARG_ROOT/bin</div><div><br></div></div>which highlighted lines should be edited based on your ncl path.</div><div style="font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style=""><font size="2">Sincerely</font></div><div dir="ltr" data-setdir="false" style=""><font size="2">Ehsan</font></div>
<div class="ydpfc6dc9ebyiv6220149868ydp86a03a40yahoo_quoted" id="ydpfc6dc9ebyiv6220149868ydp86a03a40yahoo_quoted_0748286883" style="font-size: 16px;">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
</div>
</div></div></div></div><div class="yiv6220149868yqt5940541453" id="yiv6220149868yqt76969"><div>
On Friday, September 18, 2020, 04:25:17 AM GMT+4:30, yang yang via ncl-talk <ncl-talk@mailman.ucar.edu> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="yiv6220149868ydp86a03a40yiv3440189611"><div dir="ltr">Dear Sir/Madam:<div><br clear="none"></div><div>I would like to auto-run a bash script using crontab on a linux HPC.</div><div>The bash script looks as below. Only the ncl job cannot be done. However, if I run it manually, it can be run without any problem. Can you please tell me how to make the right setting so that my bash script can be run successfully using crontab? Thank you very much!</div><div>Regards</div><div>Ed</div><div> #!/bin/bash<br clear="none">module load NCL/6.4.0-GCC-7.1.0<br clear="none">NCARG_ROOT=/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0<br clear="none">export NCARG_ROOT<br clear="none">PATH=$PATH:/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0<br clear="none">export PATH<br clear="none">cd /home/yangy/NZLAM4_READ_STA/STATION_LW_SW<br clear="none">#dir="$(date -d "1 day ago" +'%Y%m%d')"<br clear="none">dir="$(date +'%Y%m%d')"<br clear="none">echo "$dir"<br clear="none">[ ! -d $dir ] && mkdir $dir<br clear="none">#cp * $dir<br clear="none">cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir<br clear="none">rm *.nc *.dat<br clear="none">cd /niwa/oper/ecox_oper/cylc-run/nzlam_4km/share/cycle/"$dir"T12/member_1/output<br clear="none">cp escape*.nc /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir<br clear="none">cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW<br clear="none">cp read_STA_LW_12.ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"<br clear="none">cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"<br clear="none">ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"/read_STA_LW_12.ncl<br clear="none"></div></div></div>_______________________________________________<br clear="none">ncl-talk mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@mailman.ucar.edu" target="_blank" href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a><br clear="none">List instructions, subscriber options, unsubscribe:<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div></div></body></html>