<div dir="ltr">Hi Ehsan:<div><br></div><div>Thanks very much for your help!</div><div><br></div><div>I tried a few times and found it works after I have added the following in my script.</div><div>source /etc/profile >/dev/null 2>&1<br>source $HOME/.profile<br></div><div>Cheers!</div><div>Ed</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 18, 2020 at 10:33 PM Ehsan Taghizadeh via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"bookman old style","new york",times,serif;font-size:16px"><div id="gmail-m_-1506667694151035193ydpfc6dc9ebyiv6220149868"><div 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" 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"><font size="2">Sincerely</font></div><div dir="ltr"><font size="2">Ehsan</font></div>
        
        <div id="gmail-m_-1506667694151035193ydpfc6dc9ebyiv6220149868ydp86a03a40yahoo_quoted_0748286883" style="font-size:16px">
            <div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
                
                
            </div>
        </div></div></div></div><div id="gmail-m_-1506667694151035193yiv6220149868yqt76969"><div>
                    On Friday, September 18, 2020, 04:25:17 AM GMT+4:30, yang yang via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div><div id="gmail-m_-1506667694151035193yiv6220149868ydp86a03a40yiv3440189611"><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" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br clear="none">List instructions, subscriber options, unsubscribe:<br clear="none"><a rel="nofollow" shape="rect" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>