<?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: how to upload using cron in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976446#M27729</link>
    <description>Have a look/read at &lt;BR /&gt; man netrc&lt;BR /&gt;This is a way to pass user/pass etc to (ftp,sftp..etc).&lt;BR /&gt;&lt;BR /&gt;You could create a user that is only used for this purpose.&lt;BR /&gt;&lt;BR /&gt;Enjoy life&lt;BR /&gt;&lt;BR /&gt;Jean-Pierre Huc</description>
    <pubDate>Fri, 06 Apr 2007 07:33:20 GMT</pubDate>
    <dc:creator>Huc_1</dc:creator>
    <dc:date>2007-04-06T07:33:20Z</dc:date>
    <item>
      <title>how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976441#M27724</link>
      <description>Dear Experts&lt;BR /&gt;SSH server IP: 10.2.2.10&lt;BR /&gt;Ftp server IP: 10.2.2.11&lt;BR /&gt;&lt;BR /&gt;1,&lt;BR /&gt;I have to copy a file(/tmp/test.tar.gz) to the ssh server, using userid as "backadmin" and password "123" via schedule(cron). "backadmin", is the user on ssh server.&lt;BR /&gt;Now prblm is that I dont know how can i provide the userid/passwd in the crontab file.&lt;BR /&gt;So plz write me the syntax to achieve the above using cron.&lt;BR /&gt;&lt;BR /&gt;05 22 * * * /usr/bin/scp /tmp/test.tar.gz 10.2.2.10:/tmp&lt;BR /&gt;Obvously fail.. because ssh server ask for userid/passwd&lt;BR /&gt;&lt;BR /&gt;2,&lt;BR /&gt;I have to upload a file(/tmp/test.tar.gz) to the ftp server, using userid as "backadmin" and password "123" via schedule(cron). "backadmin", is the user on ftp server.&lt;BR /&gt;Now prblm is that I dont know how to ftp, and provide userid/passwd, and then upload a file, using cron.&lt;BR /&gt;&lt;BR /&gt;plz help&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Apr 2007 00:25:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976441#M27724</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2007-04-06T00:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976442#M27725</link>
      <description>Shalom Maaz,&lt;BR /&gt;&lt;BR /&gt;You can't directly upload because as you point out you need a username ans password.&lt;BR /&gt;&lt;BR /&gt;But if instead of the command line present you have an upload script with user name and password:&lt;BR /&gt;&lt;BR /&gt;sftp ap1030@sihp8024 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;&lt;PASSWORD&gt;&lt;BR /&gt;put test_file&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Modify it to your hearts content.&lt;BR /&gt;&lt;BR /&gt;My script above, scraped from itrc fixes the problem identified. Change ap1030 to the backadmin user, blah blah blah.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PASSWORD&gt;</description>
      <pubDate>Fri, 06 Apr 2007 02:29:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976442#M27725</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-04-06T02:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976443#M27726</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;This scrip may work better.&lt;BR /&gt;&lt;BR /&gt;Both servers need openssh to make this work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sftp backadmin@10.2.2.10 &amp;lt;&amp;lt;-EOF 2&amp;gt;/dev/null&lt;BR /&gt;open username passwd&lt;BR /&gt;cd /tmp&lt;BR /&gt;put /tmp/test.tar.gz&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 06 Apr 2007 02:52:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976443#M27726</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-04-06T02:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976444#M27727</link>
      <description>Thanks SEP &lt;BR /&gt;You mean that i create a script having code you provide ... and then execute the script using cron.. isint ?&lt;BR /&gt;Now prblm is that my Ftp server is MS IIS server, and I cant install the ssh on MS IIS server machine.&lt;BR /&gt;Second ... the ssh server is running redhat ES 4 but this machine doesnt have vsftpd rpm installed.. and neither I am allowed to install the rpm... so plz provide me the script which just ssh... not the ftp.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 06 Apr 2007 03:14:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976444#M27727</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2007-04-06T03:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976445#M27728</link>
      <description>Oh I got it "sftp" doesnt required "ftp server".. So plz dont consider the "Second part" of my previous post.. plz dont consider the following&lt;BR /&gt;&lt;SNIPPET&gt;&lt;BR /&gt;Second ... the ssh server is running redhat ES 4 but this machine doesnt have vsftpd rpm installed.. and neither I am allowed to install the rpm... so plz provide me the script which just ssh... not the ftp&lt;BR /&gt;&lt;/SNIPPET&gt;&lt;BR /&gt;&lt;BR /&gt;Ok SEP, as per your instruction, I create a script, and put the following code in it&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;sftp backadmin@10.2.2.10 &amp;lt;&amp;lt;-EOF 2&amp;gt;/dev/null&lt;BR /&gt;&amp;lt;123&amp;gt;  ###password of user "backadmin"&lt;BR /&gt;cd /home/backadmin&lt;BR /&gt;put /tmp/test.tar.gz&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;Now when I execute the script it succesfuly upload the test.tar.gz into the /home/backadmin ... but it ask for "password".. i.e i cant use/run this script using cron&lt;BR /&gt;&lt;BR /&gt;Plz help</description>
      <pubDate>Fri, 06 Apr 2007 05:35:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976445#M27728</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2007-04-06T05:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976446#M27729</link>
      <description>Have a look/read at &lt;BR /&gt; man netrc&lt;BR /&gt;This is a way to pass user/pass etc to (ftp,sftp..etc).&lt;BR /&gt;&lt;BR /&gt;You could create a user that is only used for this purpose.&lt;BR /&gt;&lt;BR /&gt;Enjoy life&lt;BR /&gt;&lt;BR /&gt;Jean-Pierre Huc</description>
      <pubDate>Fri, 06 Apr 2007 07:33:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976446#M27729</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2007-04-06T07:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to upload using cron</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976447#M27730</link>
      <description>Thanks Dear SEP, and HUC for help.&lt;BR /&gt;SEP, I think when the Destination server is sshd, then the best I found is "scp", with "host base authentication" to upload the file, using script, and execute the script using cron.&lt;BR /&gt;Dear HUC, I will try to follow your instruction&lt;BR /&gt;&lt;BR /&gt;Thanks Once again&lt;BR /&gt;Regards&lt;BR /&gt;Needee</description>
      <pubDate>Tue, 10 Apr 2007 00:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-upload-using-cron/m-p/3976447#M27730</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2007-04-10T00:48:58Z</dc:date>
    </item>
  </channel>
</rss>

