<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Shell script that executes FTP in cronjob in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244320#M174227</link>
    <description>Hi Sanjiv,&lt;BR /&gt;&lt;BR /&gt;Still hv some questions.&lt;BR /&gt;&lt;BR /&gt;Let said the file (abc.unl) in pluto is at /tmp/jr and I want to ftp to mercury /tmp/jr as well.&lt;BR /&gt;&lt;BR /&gt;1) Inside the script, I need to put this line as well??? #!/usr/bin/ksh&lt;BR /&gt;What does it means?&lt;BR /&gt;&lt;BR /&gt;2) For my case, means that PATH=${PATH}:(make it as per your requirement) should be PATH=$/tmp/jr ?&lt;BR /&gt;&lt;BR /&gt;3) What is this command means? lcd /ss&lt;BR /&gt;Can I put other path?&lt;BR /&gt;&lt;BR /&gt;regards.</description>
    <pubDate>Fri, 09 Apr 2004 04:12:51 GMT</pubDate>
    <dc:creator>Ngoh Chean Siung</dc:creator>
    <dc:date>2004-04-09T04:12:51Z</dc:date>
    <item>
      <title>Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244315#M174222</link>
      <description>How to write a shell script that executes FTP?&lt;BR /&gt;&lt;BR /&gt;Currently I have 2 servers (Pluto &amp;amp; Mercury).&lt;BR /&gt;I want to ftp a file (abc.unl) from pluto to mercury every morning at 9:00am. So, is there any script that can ftp this file through cronjob? I already know how to set the cronjob but just not sure about the script only.&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Fri, 09 Apr 2004 03:33:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244315#M174222</guid>
      <dc:creator>Ngoh Chean Siung</dc:creator>
      <dc:date>2004-04-09T03:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244316#M174223</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Run the script on Pluto. &lt;BR /&gt;The script should be:&lt;BR /&gt;&lt;BR /&gt;Name of the script: ftp.sh&lt;BR /&gt;&lt;BR /&gt;Contents of the script:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;PATH=${PATH}:(make it as per your requirement)&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;SERVER=`hostname`&lt;BR /&gt;&lt;BR /&gt;ftp -i -n -v mercury &amp;lt;&amp;lt; EOF&lt;BR /&gt;user root root123(password of root)&lt;BR /&gt;lcd /ss&lt;BR /&gt;put abc.unl&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;You can use any user other than root too.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 09 Apr 2004 03:45:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244316#M174223</guid>
      <dc:creator>Sanjiv Sharma_1</dc:creator>
      <dc:date>2004-04-09T03:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244317#M174224</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you don't want to put the file into the user's home dir then you have to insert a &lt;BR /&gt;cd /dir&lt;BR /&gt;before the put.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Apr 2004 03:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244317#M174224</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-04-09T03:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244318#M174225</link>
      <description>If you are going to use ftp for this, you need something like an .netrc file. But that means you have a security issue, because you will have to have the password of the remote user un-encrypted in the script or .netrc file.&lt;BR /&gt;&lt;BR /&gt;A better way might be to use scp. By distributing the public key, you can copy files without using the password.</description>
      <pubDate>Fri, 09 Apr 2004 03:53:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244318#M174225</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-04-09T03:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244319#M174226</link>
      <description>#!/usr/bin/ksh&lt;BR /&gt;#&lt;BR /&gt;/usr/bin/ftp -vn mercury &amp;lt;&lt;EOM&gt; /tmp/ftp.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWORD&gt;&lt;BR /&gt;asc&lt;BR /&gt;lcd &lt;LOCAL file="" path=""&gt;&lt;BR /&gt;cd &lt;REMOTEFILEPATH&gt;&lt;BR /&gt;put &lt;FILENAME&gt;&lt;BR /&gt;bye&lt;BR /&gt;EOM&lt;BR /&gt;/usr/bin/grep -q "^[45]" /tmp/ftp.log&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Errors found.  Check FTP log"&lt;BR /&gt;  exit 1&lt;BR /&gt;else&lt;BR /&gt;  exit 0&lt;BR /&gt;fi&lt;BR /&gt;# end of script&lt;/FILENAME&gt;&lt;/REMOTEFILEPATH&gt;&lt;/LOCAL&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/EOM&gt;</description>
      <pubDate>Fri, 09 Apr 2004 03:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244319#M174226</guid>
      <dc:creator>John Kelly_3</dc:creator>
      <dc:date>2004-04-09T03:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244320#M174227</link>
      <description>Hi Sanjiv,&lt;BR /&gt;&lt;BR /&gt;Still hv some questions.&lt;BR /&gt;&lt;BR /&gt;Let said the file (abc.unl) in pluto is at /tmp/jr and I want to ftp to mercury /tmp/jr as well.&lt;BR /&gt;&lt;BR /&gt;1) Inside the script, I need to put this line as well??? #!/usr/bin/ksh&lt;BR /&gt;What does it means?&lt;BR /&gt;&lt;BR /&gt;2) For my case, means that PATH=${PATH}:(make it as per your requirement) should be PATH=$/tmp/jr ?&lt;BR /&gt;&lt;BR /&gt;3) What is this command means? lcd /ss&lt;BR /&gt;Can I put other path?&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Fri, 09 Apr 2004 04:12:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244320#M174227</guid>
      <dc:creator>Ngoh Chean Siung</dc:creator>
      <dc:date>2004-04-09T04:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244321#M174228</link>
      <description>Hi NCS,&lt;BR /&gt;&lt;BR /&gt;let me clarify it.&lt;BR /&gt;What Sanjiv posted is a ftp script within a korn shell script.&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;means this script is to be run by korn shell&lt;BR /&gt;You do not need the PATH statement, if you explicitely run all commands with full path.&lt;BR /&gt;lcd sets the local directory to get the file from.&lt;BR /&gt;cd sets the directory on the remote host to put the file to.&lt;BR /&gt;&lt;BR /&gt;you can specify any existing directories on your hosts as long as you have the necessary rights.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Apr 2004 04:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244321#M174228</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-04-09T04:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244322#M174229</link>
      <description>So, the script is likes:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;ftp -i -n -v mercury &amp;lt;&amp;lt; EOF&lt;BR /&gt;user &lt;USERNAME&gt; &lt;PASSWORD&gt;&lt;BR /&gt;asc&lt;BR /&gt;lcd /tmp/jr&lt;BR /&gt;cd /tmp/jr&lt;BR /&gt;put abc.unl&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;1) What is asc stands for?&lt;BR /&gt;&lt;BR /&gt;2) If I want to ftp more than 1 file, I need to key in bin and then follow by prompt. Then I can use mput command, right. So, where should I put in the bin and prompt command? Btw, what are bin and prompt stand for?&lt;BR /&gt;&lt;BR /&gt;3) Is bye and quit command same? I think in FTP, we should use bye, right?&lt;BR /&gt;&lt;BR /&gt;4) What is the difference among EOF, EOM and EOD?&lt;BR /&gt;&lt;BR /&gt;regards.&lt;/PASSWORD&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Fri, 09 Apr 2004 05:03:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244322#M174229</guid>
      <dc:creator>Ngoh Chean Siung</dc:creator>
      <dc:date>2004-04-09T05:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244323#M174230</link>
      <description>1. asc is short for ascii.  This tells ftp that the files for transfer are text files.  Use bin for data files or executables.&lt;BR /&gt;&lt;BR /&gt;2. bin - see 1.  If you don't want prompts when transferring multiple files (using mput) add -i in the ftp command line.  E.g. ftp -i -n -v hostname.&lt;BR /&gt;&lt;BR /&gt;3. bye and quit do the same thing.&lt;BR /&gt;&lt;BR /&gt;4. In the examples, EOM and EOD are start and end markers for the ftp commands.  It could be any text string.</description>
      <pubDate>Fri, 09 Apr 2004 09:53:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244323#M174230</guid>
      <dc:creator>John Kelly_3</dc:creator>
      <dc:date>2004-04-09T09:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244324#M174231</link>
      <description>May I know what is the different between Korn shell script and POSIX shell script? What I know is Korn shell script is to be executed by /usr/bin/ksh and POSIX shell script is to be executed by /usr/bin/sh. Any other things besides this?&lt;BR /&gt;&lt;BR /&gt;Inside the script, we need to determine whether the script is executed by Korn or POSIX. Example: #! /usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;Is there any setting that we can make to enable every script that we write will be executed by POSIX shell script only without specify inside the script?&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Sun, 11 Apr 2004 21:41:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244324#M174231</guid>
      <dc:creator>Ngoh Chean Siung</dc:creator>
      <dc:date>2004-04-11T21:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244325#M174232</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The difference is there in the shell. POSIX shell  is the default shell from HPUX 10.2 and above. POSX shell is /usr/bin/sh while the Korn shell is /usr/bin/ksh.&lt;BR /&gt;&lt;BR /&gt;By default, the script gets executed in the POSIX shell or the shell defined to the user.&lt;BR /&gt;&lt;BR /&gt;With best wishes&lt;BR /&gt;Naveej</description>
      <pubDate>Sun, 11 Apr 2004 22:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244325#M174232</guid>
      <dc:creator>Naveej.K.A</dc:creator>
      <dc:date>2004-04-11T22:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244326#M174233</link>
      <description>Hi,&lt;BR /&gt;What you mean is actually there is no different either the script was executed by POSIX or Korn. The result is still the same. Am I right?&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Sun, 11 Apr 2004 22:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244326#M174233</guid>
      <dc:creator>Ngoh Chean Siung</dc:creator>
      <dc:date>2004-04-11T22:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script that executes FTP in cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244327#M174234</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes exactly, i don't find any difference in the way features that POSIX and KORN shells have.  Both has command history, command line editing, arithematic evaluation, coprocess facility....&lt;BR /&gt;&lt;BR /&gt;The root user's shell is the posix shell always, as there is no /sbin/ksh..&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;Naveej</description>
      <pubDate>Mon, 12 Apr 2004 00:00:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-that-executes-ftp-in-cronjob/m-p/3244327#M174234</guid>
      <dc:creator>Naveej.K.A</dc:creator>
      <dc:date>2004-04-12T00:00:55Z</dc:date>
    </item>
  </channel>
</rss>

