Re: Copying files over the Network

From: JOSEPH KREMBLAS (JKREMBLAS_at_REDHEARTGIFTS.COM)
Date: 08/28/04

  • Next message: Hunter, Mark: "Re: Copying files over the Network"
    Date:         Sat, 28 Aug 2004 12:31:11 -0700
    To: aix-l@Princeton.EDU
    
    

    Saturday, August 28, 2004 A.D.

    Hi, Vipin,

            "Flummoxed?" Nice choice of words :) I had to look this one up
    in the dictionary--which means confounded or confused. It appears on its
    face that you are using root. As such, when using RCP or RSH as root,
    the /etc/hosts.equiv file IS NOT check; instead, authentication for root
    is passed to the $HOME/.rhosts file.

            Some Notes.--If an /etc/hosts.equiv file does not exist on the
    TARGET system, or does exist but does not authorize the USER on the
    remote system, then the $HOME/.rhosts file will be looked at for USER
    AUTHENTICATION. Make sure that the permissions on the $HOME/.rhosts
    file are set correctly, otherwise the authentication process
    fails--quite miserably at that. The "permissions" rule applies equally
    to the /etc/hosts.equiv file as well. I'll leave it at this and allow
    you to research this yourself. If you are still flummoxed, please
    advise.

            I hope this helps.

            Best wishes,

            Joseph Kremblas
            IBM Certified Advanced Technical Expert--RS/6000 AIX
            IBM Certified Specialist--pSeries AIX 5L Systems Support
            IBM Certified Specialist--pSeries AIX 5L Systems Administration
            IBM Certified Specialist--RS/6000 SP and PSSP
            IBM Certified Solutions Expert--WebSphere MQ/MQSeries
            IBM Certified Specialist--WebSphere MQ/MQSeries
            Phone: (623) 877-5722

            "Doubt is a pain too lonely to know that faith is his twin
    brother."

            All Rights Reserved.

    -----Original Message-----
    From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
    Vipin Khushu - SuSe
    Sent: Friday, August 27, 2004 6:16 PM
    To: aix-l@Princeton.EDU
    Subject: Re: Copying files over the Network

    I'm flummoxed. When I attempt Simon's tar command or Mark Ray's rcp
    command, I get Permission Denied in both cases.

    .rhosts files on both machines have been updated with the other's host
    name.

    I have also updated the hosts.equiv files on both machines for good
    measure.

    Here's what I get when I execute the rcp command:

    # rcp -p -r hostnameA:/u/abcd/* hostnameB:/u/abcd
    rshd: 0826-813 Permission is denied.
    Would one of you please post a sample user, .rhosts, etc set up so I can
    configure accordingly.
    thanks.
    Vipin-

    One important consideration is whether you need to clean-up things on
    machine B.

    e.g. The first time, you copy file1 and file2 from A to B.
    When you come to the next copy, file1 has been updated but file2 no
    longer exists. Do you need to remove file2 from machine B?

    Could files on Machine B be updated, so that they have a later timestamp
    than those on machine A? If so, what do you want to happen?

    Generally, I would recommend rdist for this. However, if your needs are
    relatively simple - if the directory on machine B gets cleared down
    before the copy, for example - I'd use a combination of rsh and tar or
    backup/restore.

    e.g. tar -cf - /your/directory | rsh machineB tar -xf -

    This is good, because it preserves modification times as well as
    permissions. You can do the same thing with backup/restore, which is
    better for large amounts of data and for database files.

    Simon Green
    Altria ITSC Europe Ltd
    AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html
    New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX
    N.B. Unsolicited email from vendors will not be appreciated.
    Please post all follow-ups to the list.

    Using rcp ("Remote Copy Procedure"), the syntax would be:

    rcp -p -r machineA:/directory/* machineB:/target_directory

    The -p flag preserves attributes, while the -r flag recursively descends
    and copies
    subdirectories and files. To make this a recurring thing, add this line
    into your
    crontabs. Remember you need a .rhosts file on each machine containing
    each
    other's hostnames.

    Best,

    Mark Ray
    AIX and TSM Systems Support
    New England Gas, Company

    -----Original Message-----
    From: Vipin Khushu - SuSe [mailto:vkhushu@GUERNSEYOP.COM]
    Sent: 26 August 2004 23:14
    To: aix-l@Princeton.EDU
    Subject: Copying files over the Network

    I need to copy the contents of a directory, including sub-directories,
    and all files contained in those directories from machine A to machine B
    over the network, in a recurring fashion, say once every 24 hours.

    The file types include binaries and text files.

    I'd like to maintain the permissions of the files as they exist in
    machine A.

    Any tips, suggested commands, etc would be greatly appreciated.


  • Next message: Hunter, Mark: "Re: Copying files over the Network"

    Relevant Pages

    • Re: Copying files over the Network
      ... I had previously taken the time to read the appropriate stanzas in the commands documentation relating to Permissions and command behavior when using root. ... Mark, your recommendation to use who am i proved to be the key to the issue. ...
      (AIX-L)
    • Re: Copying files over the Network
      ... Copying files over the Network ... Make sure that the permissions on the $HOME/.rhosts ... When I attempt Simon's tar command or Mark Ray's rcp ...
      (AIX-L)
    • Re: Sharing complete HD?
      ... Command-line is easy - we can just tell you the command to type. ... To solve your problem via GUI, we need to know exactly what you have installed, and what you are using to manage Samba from the Linux side. ... The chmod thing that people are suggesting, is just to change the permissions on the directory that you are sharing. ... In order to do this you will probably need to have root authority - so either drive the UI as root, or use some feature of the UI to change to root for this operation. ...
      (uk.comp.os.linux)
    • Re: [PHP] scandir() in automount/autofs
      ... the $util object is not actually running the command but it is inserting the ... It means the command in $util->run_commandis executing with root ... I'm pretty sure it is because of the permissions on the mounted usb ...
      (php.general)
    • Program runs for "root", not for regular user
      ... fine when I'm "root", but gets a "command not found" error when I run it as ... I'm guessing it's a permissions error or something. ... As a regular user, if I ... type just the executable name "komodo", I get a "command not found" error. ...
      (comp.os.linux.misc)

    Loading