Find the answer to your Linux question:
Results 1 to 3 of 3
I want to: 1. ftp a file (i.e.) abc.txt to a linux server (/tmp) 2. waiting for the transfer of abc.txt to finish 3. move the abc.txt to other location ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    4

    Cron or other ways?

    I want to:

    1. ftp a file (i.e.) abc.txt to a linux server (/tmp)
    2. waiting for the transfer of abc.txt to finish
    3. move the abc.txt to other location AT ONCE

    concern:
    What programs/ways could monitor if the abc.txt is finished the transfer so I could start to move the file without any delay (<1 second)?

    Thanks!

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    You can run a script that sleeps, checks for files to move, and then moves them. The worst-case latency would be the sleep period (as small as 1 second). Since there is no way to tell if the file transfer is complete without some indicator, I would suggest a flag (a file name extension) to tell the script that the actual file is ready to transfer. For example, the flag could be .done, so the actual file, when complet is named abc.txt.done, telling the script that it is ready to be moved as abc.txt. So, your sending computer will first ftp the file with it's real name, abc.txt, then it can rename the file to abc.txt.done. You script will see the file ending in .done, and then transfer the file to wherever, but stripping off the .done extension.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    4
    Hi Rubberman,

    Thanks for suggestion!

Posting Permissions

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