<?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: FTP Script for Backups in Bourne Shell - Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528254#M728640</link>
    <description>Hi Laurie:&lt;BR /&gt;If it were me I would avoid ftp simply because of the need for plaintext passwords unless you use anonymous ftp which defeats the whole purpose. I think I would do something like this using rcp:&lt;BR /&gt;FILES="/xxx/file1.gz /yyy/file2.gz"&lt;BR /&gt;REMOTE_HOME=elvis&lt;BR /&gt;for X in ${FILES}&lt;BR /&gt;  do&lt;BR /&gt;     rcp -p ${X} ${REMOTE_HOST}:${X}&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
    <pubDate>Mon, 14 May 2001 21:23:05 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-05-14T21:23:05Z</dc:date>
    <item>
      <title>FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528252#M728638</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to have a script run from Server A to&lt;BR /&gt;Server B every night at 4am.&lt;BR /&gt;&lt;BR /&gt;I wasn't sure if it was possible to script ftp commands on UNIX.  I want to use a script to mounts Server A file system and then copies the data to Server B and then dismounts when done until all the files are copied over.&lt;BR /&gt;&lt;BR /&gt;Server A is our production server and Server&lt;BR /&gt;B is our test server at another physical location.&lt;BR /&gt;&lt;BR /&gt;The files look like this:&lt;BR /&gt;&lt;BR /&gt;/db01/syb115/backup/*.gz&lt;BR /&gt;/db02/syb115/backup/*.gz&lt;BR /&gt;/db03/syb115/backup/*.gz&lt;BR /&gt;&lt;BR /&gt;This would enable us to have live backups&lt;BR /&gt;at another site. I need a script and a cron&lt;BR /&gt;job update.  You guys are great for helping me.. Thank You So Much...&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;Laurie</description>
      <pubDate>Mon, 14 May 2001 20:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528252#M728638</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-05-14T20:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528253#M728639</link>
      <description>Hi Laurie:&lt;BR /&gt;&lt;BR /&gt;Here are two scripts:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;ftp -n &amp;lt;&amp;lt; EOF &lt;BR /&gt;verbose &lt;BR /&gt;open thehost &lt;BR /&gt;user uuu ppp &lt;BR /&gt;get /tmp/stuff &lt;BR /&gt;close &lt;BR /&gt;EOF &lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;{ echo "open thehost &lt;BR /&gt;user uuu ppp &lt;BR /&gt;hash &lt;BR /&gt;mput * &lt;BR /&gt;close" &lt;BR /&gt;} | ftp -i -n -v 2&amp;gt;&amp;amp;1 | tee /tmp/ftplog.$$ &lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 14 May 2001 21:17:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528253#M728639</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-14T21:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528254#M728640</link>
      <description>Hi Laurie:&lt;BR /&gt;If it were me I would avoid ftp simply because of the need for plaintext passwords unless you use anonymous ftp which defeats the whole purpose. I think I would do something like this using rcp:&lt;BR /&gt;FILES="/xxx/file1.gz /yyy/file2.gz"&lt;BR /&gt;REMOTE_HOME=elvis&lt;BR /&gt;for X in ${FILES}&lt;BR /&gt;  do&lt;BR /&gt;     rcp -p ${X} ${REMOTE_HOST}:${X}&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Mon, 14 May 2001 21:23:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528254#M728640</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-14T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528255#M728641</link>
      <description>Hi Laurie:&lt;BR /&gt;&lt;BR /&gt;Two more points for questions I suspect you will ask as soon as you read the above posts:&lt;BR /&gt;&lt;BR /&gt;1.  Embedding a password in a script isn't the most desirable thing to do from a security perspective.  A "better" approach may be to use a '.netrc' file ['man 4 netrc'] in which you can isolate the password (in one place).&lt;BR /&gt;&lt;BR /&gt;2.  In order to ascertain the success or failure of a scripted ftp, parse the messages logged from the session.  I use the second script to capture the server/client dialog.  Note that the '-v' [verbose] option is set and both stdout &amp;amp; stderr are redirected to a file. The messages from the session contain numbered text.  From the 'ftpd (1m)' man pages you can note that "Every command produces at least one reply, although there may be more than one. A reply consists of a three-digit number, a space, some text...The number must conform to this standard, but the text can vary...The first digit of the message indicates whether the reply is good, bad, or incomplete."  Thus, use the numbers associated with the text of the messages to discern the success or failure of the process.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 14 May 2001 23:12:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528255#M728641</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-14T23:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528256#M728642</link>
      <description>You said somthing about mounting. If you can mount the drive you could do something as simple as:&lt;BR /&gt;&lt;BR /&gt;/etc/mount serverA:/db01 /backupsource&lt;BR /&gt;/usr/bin/cp -rp /backupsource/syb115/backup/*.gz /backupdir/db01&lt;BR /&gt;/etc/umount /backupsource&lt;BR /&gt;(same for db02 and db03)&lt;BR /&gt;&lt;BR /&gt;Use full pathnames if you set this up as a script run by cron. Of course you can do this copies in a while- or for-loop.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Stefan</description>
      <pubDate>Tue, 15 May 2001 07:55:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528256#M728642</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2001-05-15T07:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528257#M728643</link>
      <description>See &lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xfea1ee3e323bd5118fef0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xfea1ee3e323bd5118fef0090279cd0f9,00.html&lt;/A&gt;</description>
      <pubDate>Tue, 15 May 2001 08:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528257#M728643</guid>
      <dc:creator>Vincenzo Restuccia</dc:creator>
      <dc:date>2001-05-15T08:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528258#M728644</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;When I try to do the rcp just in the shell&lt;BR /&gt;I get this error below..what does this mean?&lt;BR /&gt;I am excuting this as root and the file is&lt;BR /&gt;own by syb115 (sybase database) and group&lt;BR /&gt;is syb115 for the files.&lt;BR /&gt;&lt;BR /&gt;remshd: Login incorrect.&lt;BR /&gt;&lt;BR /&gt;I can do nslookup on the target host, we are&lt;BR /&gt;all on the same network.&lt;BR /&gt;&lt;BR /&gt;Also what would be my cron entry to execute&lt;BR /&gt;this every day at 4am and send me email?&lt;BR /&gt;&lt;BR /&gt;THANK YOU&lt;BR /&gt;Laurie</description>
      <pubDate>Tue, 15 May 2001 14:16:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528258#M728644</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-05-15T14:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528259#M728645</link>
      <description>Hi Laurie,&lt;BR /&gt;&lt;BR /&gt;No problem - this is normal. We have to tell machine A that machine B is trustworthy. You have permission problems.&lt;BR /&gt;I would do this on all machines that wish to execute the 'r' commands (rlogin,remsh,rcp,etc.):&lt;BR /&gt;&lt;BR /&gt;1)Make sure there is an /etc/hosts.equiv file;&lt;BR /&gt;the format is:&lt;BR /&gt;machineA&lt;BR /&gt;machineB&lt;BR /&gt;machineC&lt;BR /&gt;&lt;BR /&gt;(you can man hosts.equiv for more details and options). I would set the permissions to 644 and owned by root:root.&lt;BR /&gt;&lt;BR /&gt;2) You also need to create a .rhosts file in the user's home directory (in this case root so I'll assume '/.rhosts'. I would do this on all the machines in question as well.&lt;BR /&gt;The format should be something like this:&lt;BR /&gt;machineA root&lt;BR /&gt;machineB root&lt;BR /&gt;machineC root&lt;BR /&gt;&lt;BR /&gt;You can man .rhosts for details and other options for this file. I would also man remshd - you need to know the details of the remote executions and how they work.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 May 2001 14:27:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528259#M728645</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-15T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528260#M728646</link>
      <description>you need to put the file .rhosts with the host names in the file. example:&lt;BR /&gt;&lt;BR /&gt;hosta root</description>
      <pubDate>Tue, 15 May 2001 14:31:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528260#M728646</guid>
      <dc:creator>Jim Moffitt_1</dc:creator>
      <dc:date>2001-05-15T14:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528261#M728647</link>
      <description>Hi Laurie,&lt;BR /&gt;I forgot, set the permissions of the .rhosts&lt;BR /&gt;file to 600. Owner should be root:root.&lt;BR /&gt;&lt;BR /&gt;If you like (and it's a bit more secure), you&lt;BR /&gt;can also set the hosts.equiv permissions to 600.&lt;BR /&gt;&lt;BR /&gt;Again, I urge you to read the man pages on these files so that you understand the permissions implications.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Tue, 15 May 2001 14:34:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528261#M728647</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-15T14:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528262#M728648</link>
      <description>Hi Laurie:&lt;BR /&gt;&lt;BR /&gt;The question of the /etc/hosts.equiv and $HOME/.rhosts files has already been answered above, so:&lt;BR /&gt;&lt;BR /&gt;Your crontab should look something like:&lt;BR /&gt;&lt;BR /&gt;00 04 * * * the_script&lt;BR /&gt;&lt;BR /&gt;By default, if you do not redirect stdout and stderr, any generated standard output or standard error will be mailed to the user.&lt;BR /&gt;&lt;BR /&gt;Be sure, too, to include any environmental variables you need in your script before "cron"ing it.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 15 May 2001 14:35:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528262#M728648</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-15T14:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Script for Backups in Bourne Shell - Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528263#M728649</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I can get the command to work only for one&lt;BR /&gt;file. When I try to run this for all the&lt;BR /&gt;files with a wildcard I get this error for&lt;BR /&gt;each file:&lt;BR /&gt;&lt;BR /&gt;usage: rcp [-p] [ -S size ] [ -R size ] f1 f2; or: rcp [-rp] [ -S size ] [ -R sy&lt;BR /&gt;./sybase_backup[10]: /db01/syb115/backup/DBSpscbbk1.gz: Execute permission denied&lt;BR /&gt;&lt;BR /&gt;Also when I run the rcp -p command for one&lt;BR /&gt;file from the shell, it does NOT keep the&lt;BR /&gt;same file permissions and owner and group.&lt;BR /&gt;It does this:&lt;BR /&gt;rw-------   1 root       sys        12242402 May 14 21:41 laurie&lt;BR /&gt;&lt;BR /&gt;When it should leave the permissions to the&lt;BR /&gt;orginial file:&lt;BR /&gt;&lt;BR /&gt;-rw-------   1 syb115     syb115      460911 May 14 21:00 masterbk1.gz&lt;BR /&gt;&lt;BR /&gt;Anyway clues what I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Laurie&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 May 2001 17:09:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-for-backups-in-bourne-shell-script/m-p/2528263#M728649</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-05-15T17:09:12Z</dc:date>
    </item>
  </channel>
</rss>

