Using automator (or something else) to delete files from ftp server

Discussion in 'Mac Programming' started by Dimwhit, Jan 12, 2015.

  1. Dimwhit macrumors 68000

    Dimwhit

    Joined:
    Apr 10, 2007
    #1
    I created an automator service to select a file and upload it to an ftp server. I have to do this regularly. But what I really need to do is delete the files in that remote directory before the file uploads.

    Anyone know how, or if, that can be done?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    What's in your Automator upload service?

    Is it a "Run AppleScript" action? A shell script action? Commands to a Terminal window? AppleScript commands to an FTP client app?


    What is your OS version?
     
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    Python has an ftplib built in that makes FTP tasks pretty trivial.
     
  4. Dimwhit thread starter macrumors 68000

    Dimwhit

    Joined:
    Apr 10, 2007
    #4
    I'm using a Transmit upload service. In on Yosemite (latest version).
     
  5. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #5
    I've not tried curl on the command line for this particular purpose, but it looks like you *can* use it to delete files over ftp. Check out instructions on this page:

    http://www.slashroot.in/curl-command-tutorial-linux-example-usage

    (Look for "Deleting files on FTP server", about half way down)

    I'm assuming curl is pretty much the same on Linux and OS X. Hope that's of some help!
     

Share This Page