Results 1 to 5 of 5

Thread: loop script

  1. #1
    Join Date
    Dec 2009
    Posts
    28

    Post Unanswered: loop script

    Dear Sir
    I looking why to write a small script that try to copy a remote file to my local server but i want my script to insist untill the file is copied because somethime the communication line is busy and i should re execute the script. How can i design it in aix environement. Both server have aix OS
    thanks

  2. #2
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Code:
    EXIT=1
    while [ $EXIT -ne 0 ];do
        scp ...
        EXIT=$?
    done
    Regards,
    Hans

  3. #3
    Join Date
    Dec 2009
    Posts
    28

    Post next step2

    Dear Sir
    If my script is build to copy a remote file untill the copy return a file. Please help me to apply the loop statement to this command
    cd /home
    rcp remote_server:/home/thefile .
    exit

  4. #4
    Join Date
    Dec 2009
    Posts
    28

    step 4

    Dear Sir
    I am still waiting the example of loop script which would permit me to copy a remote file. I received this code before but i am not able to adapt it to a loop instruction.
    The copy command is the following rcp remote_server:/home/file_to_copy .

    EXIT=1
    while [ $EXIT -ne 0 ];do
    scp ...
    EXIT=$?
    done

    Thanks

  5. #5
    Join Date
    Nov 2004
    Posts
    60
    EXIT=1
    while [ $EXIT -ne 0 ];do
    rcp remote_server:/home/file_to_copy .
    EXIT=$?
    done

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •