Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I have an FTP server I work with on a consistent basis that I access my work orders from. When I am done with the order I have to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    2

    FTP Help: Rsync Curlftpfs


    Hello,
    I have an FTP server I work with on a consistent basis that I access my work orders from.
    When I am done with the order I have to send the completed file back with the same name to a different folder on the ftp server.
    The problem I am running into is removing the original order from the order folder. As of right now I have to do it all by hand and need to find a way to automate this function.
    I have to keep the working orders on the server removing all of them and doing this on my HD is not an option.

    What I want to do is have a script or function that will look in a particular folder and delete all the ones that match it on the server.
    Is this possible? Is there a program already created that will do this?
    I have not used FTP in linux as of yet so I am asking this as a total noob
    I was suggested on one forum that I needed to mount the ftp server with curlftpfs and then use rsync to eliminate the matching files.
    I have tried this but can not get rsync to do what I want it to do. Maybe I am not doing something right.
    Here is the command that I am trying to use and was suggested to use
    PHP Code:
    rsync --progress --remove-source-files /home/o0ljzakl0o/all /home/o0ljzakl0o/nlftp/Requests 
    The /all folder contains a copy of the orders that were uploaded to the completed folder on the ftp server and the /Requests is the location of the mounted ftp
    server
    All completed files are sent to a completely different part of the ftp server which I am as of right now not even messing with.
    Any suggestions as to what I am doing wrong.
    Im a total noob to linux in general and am learning this as I go. I have spent several hours looking through the man trying to understand what is wrong but I can not figure it out.
    If anyone here can help me out I would greatly appreciate it
    Thank you

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    Quote Originally Posted by Jzak View Post
    Hello,
    I have an FTP server I work with on a consistent basis that I access my work orders from.
    When I am done with the order I have to send the completed file back with the same name to a different folder on the ftp server.
    The problem I am running into is removing the original order from the order folder. As of right now I have to do it all by hand and need to find a way to automate this function.
    I have to keep the working orders on the server removing all of them and doing this on my HD is not an option.

    What I want to do is have a script or function that will look in a particular folder and delete all the ones that match it on the server.
    Is this possible? Is there a program already created that will do this?
    I have not used FTP in linux as of yet so I am asking this as a total noob
    I was suggested on one forum that I needed to mount the ftp server with curlftpfs and then use rsync to eliminate the matching files.
    I have tried this but can not get rsync to do what I want it to do. Maybe I am not doing something right.
    Here is the command that I am trying to use and was suggested to use
    PHP Code:
    rsync --progress --remove-source-files /home/o0ljzakl0o/all /home/o0ljzakl0o/nlftp/Requests 
    The /all folder contains a copy of the orders that were uploaded to the completed folder on the ftp server and the /Requests is the location of the mounted ftp
    server
    All completed files are sent to a completely different part of the ftp server which I am as of right now not even messing with.
    Any suggestions as to what I am doing wrong.
    Im a total noob to linux in general and am learning this as I go. I have spent several hours looking through the man trying to understand what is wrong but I can not figure it out.
    If anyone here can help me out I would greatly appreciate it
    Thank you
    There are other ways to skin this cat, but I'd do it with a simple script:

    Code:
    #!/bin/bash
    cd /home/o0ljzakl0o/all
    ls -1|while
      read file
      do
        rm /home/o0ljzakl0o/nlftp/Requests/"$file"
      done
    It could be done with less code, but this way is very clear and easy to follow.

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Posts
    2
    Thank you!
    That worked like a charm!

Posting Permissions

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