Automating FIle Uploads to Your Webserver using a Mac

Sometimes, it’s nice to shake up routine. For the past 14 years, I have been manually uploading my comics to my FTP server. This procedure involved three steps:

  1. Open my FTP application (Transmit)
  2. Navigate to the proper folder on my computer
  3. Drag the file into the appropriate folder on the server. (I keep all my comics within the same folder on my server.)

As is the case with my comics, every time I make a revision (and in some cases I’ve revised a strip 20 times over the course of a day), I’d have to repeat the above steps each and every time.

So…

…given all the whiz-bang computing power we have at our disposal in 2012, shouldn’t there be a better way?

Thankfully there is, and it’s called automation. To automate the steps above, I used two applications: Hazel and Automator.

Hazel ($24.99) is an incredibly powerful program that automates filing, organizing and cleaning files and folders that live on your computer. Automator is an app bundled with Mac OS X that bills itself as a “personal automation assistant” using drag-and-drop workflows.

To preface this discussion: there are many ways to skin this cat. This is what worked for me.

hazel_automator_workflow_1

First, I’ve created a rule within Hazel called “Latest Toons”. This rule will examine the date of the file and checks to see if it was created within the current week. If that condition is true, two actions will be performed.

  1. Hazel will set a color label on the file (marking it green).
  2. Hazel will launch an Automator workflow to upload the file to the appropriate folder on my server

hazel_automator_workflow_2

hazel_automator_workflow_3

I use Panic’s Transmit ($24.99) for all my FTP tasks. Transmit comes with an Upload action that is accessible from within Automator.

In Automator, I selected the Upload action and moved it into the workflow area. Next, I configured the Upload action to use one of my Transmit “Favorites” (a bookmark of sorts that contains all my FTP login info, including the correct path to open on the server). After configuring the action, I saved the workflow for Hazel to access.

hazel_automator_workflow_4

Now, whenever a new comic file is saved in my pcw_toons folder, Hazel automatically uploads the file into the appropriate folder on my server. Translation: I’ll never have to manually upload a comic to my FTP server EVER again!

To sum it up: Automation is a powerful method of saving time on repetitive tasks. It lets your computer handle the mundane, routine activities while freeing you up to focus on the real tasks at hand. And with tools like Hazel and Automator on the Mac, it’s never been easier!

-Krishna

These beautiful and intelligent people wrote

  • ShaneReply
    May 22, 2012 at 10:03 pm

    I haven’t used a mac for about 6 months but with transmit I setup bookmarks to have local and remote paths so once connected the local and remote lists matched what I wanted, then I would click synchronise to have transmit upload all local changes to the server. You could probably get automator to do that without using hazel.

    • KrishnaReply
      May 23, 2012 at 5:38 am

      I’ve never been able to get Automator to auto-perform something based on a condition (new file added into a folder etc). Maybe it’s fully possible and I’m missing something…

  • kaitouReply
    May 24, 2012 at 10:32 pm

    I hope by “ftp” you mean “sftp” (secure ftp). Ftp send everything, files and login info, in clear-text; bad idea. Both sftp and scp encrypt the connection. From what I understand, Transmit does know how to do sftp. I have no idea if Hazel supports it or not (their website does not mention it that I could find).

    I believe scp/sftp are native on OSX in command line form. You can also use Fugu (an opensource GUI frontend for scp/sftp/ssh) or one of several other programs. I can’t imagine it would be too hard to set up a script to use scp/sftp on the Mac.

  • Jason DowningReply
    June 11, 2012 at 1:02 pm

    You should give Yummy FTP Watcher a go. It’s designed for this purpose, watching a local folder for changes and auto-syncing them to an FTP/SFTP server. Costs $5

    http://www.yummysoftware.com/Product-Information-Watcher

  • George CoghillReply
    December 30, 2013 at 3:16 pm

    Even better, Hazel now has FTP built-in.

Tell me what you think!

  • This site uses Akismet to reduce spam. Learn how your comment data is processed.