Copying multiple files, from remote m/c with preserving Path - Unix

This is a discussion on Copying multiple files, from remote m/c with preserving Path - Unix ; Hi i have m/c A. I have around 700 files (each file of around 1 MB), All files are not in same path, but scattered across 100 Various path. I have list of files and their absolute pathready.(so that i ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Copying multiple files, from remote m/c with preserving Path

  1. Copying multiple files, from remote m/c with preserving Path

    Hi

    i have m/c A. I have around 700 files (each file of around 1 MB), All
    files are not in same path, but scattered across 100 Various path. I
    have list of files and their absolute pathready.(so that i can write a
    script !)


    Now i need to remove these files. But before removing it, i wanted to
    take backup of all files on Machine B[Machine A and B are in local
    network!],

    i.e. if i am having Backup directory like this on Machine B /home/
    raxit/machineAbackup/

    Machine A: /usr/raxit/File1.tar --->Machine B:/home/raxit/
    machineAbackup/usr/raxit/File1.tar
    Machine A: /usr/sheth/FileXyz.tar --->Machine B:/home/raxit/
    machineAbackup/usr/sheth/FileXyz.tar

    Any idea how to copy like this way, So that it maintain relative
    path !?

    thanks in Advance,
    Raxit



  2. Re: Copying multiple files, from remote m/c with preserving Path

    "ra...@m4mum.com" wrote:
    >
    > i have m/c A. *I have around 700 files (each file of around 1 MB), All
    > files are not in same path, but scattered across 100 Various path. *I
    > have list of files and their absolute pathready.(so that i can write a
    > script !)
    >
    > Any idea how to copy like this way, So that it maintain relative
    > path !?


    That's what cpio is for

    cpio -o < list_of_files | rsh targethost "cd /targetdir ; cpio -idumv"

    You want relative paths, so trim the leading / in the list file first.

+ Reply to Thread