I Hate FTP [en]

[fr] Je hais le FTP. Donnez-moi un accès SSH et screen sur le serveur, et me voilà heureuse.

Ever since I discovered the magical combination of SSH + screen, I have come to loathe FTP. Although some of you will cringe at the idea, I like working directly on the server. No stray copies lying around, dated I-don’t-know-what. No chance of mistakenly overwriting your last set of changes.

Screen is a terminal multiplexer (just learned the term). What you do, basically, is climb inside it when you’re on the server, and do everything from there. The advantage is that:

  • when you disconnect your SSH connection, screen keeps running, so your workspace is how you left it next time you come in
  • you can have multiple “screens” (ie, terminal windows) you can easily switch around, so you can have your IRC channel running in one screen, be editing a file in another, etc. (basically, multi-tasking like you would do with windows in a graphical environment).

I learnt shell commands as I went along. Those I use the most are:

  • wget http://wordpress.org/latest.zip to download (instantly!) the latest version of WordPress directly on the server
  • unzip latest.zip to unzip it, still directly on the server
  • mv wp old-200910 to archive an old installation of wordpress (or move other files around)
  • cp -Rf plugins/* ../../wordpress/wp-content/plugins/ to copy all my plugins to the freshly unzipped install of WordPress
  • nano wp-config-sample.php to add my settings to the file and save it as wp-config.php

These are just a few examples. Once you know these commands and have them at the tip of your fingers, how fast you work is only limited by how fast you can type them. And you’re doing things directly on the web server. You’re not stuck looking at the “real world” (= the server) through the imperfect lens of an FTP client, waiting for uploads to happen (or downloads), paying attention not to overwrite stuff, having everything ready on your computer before pressing the magic button and hoping everything will be all right, because otherwise you’re in for another bout of download, edit, upload…

Some of my clients have WordPress installations on servers with no shell access. Obviously, I don’t have as much practice doing things the FTP way, but I swear it takes me 5 times as much time to do things with no SSH access. When you know how to use it, the command-line is wickedly fast.

The only situation where I actually do like FTP is when I’m using CSSEdit, because coupled to an FTP client, I can be editing my CSS file with the added power of the programme on my Mac, and have it upload and update the file on the server each time I hit save. Because yes, it’s nicer to write CSS in CSSEdit than in nano.

But for managing files and moving them around and minor edits… I’m much happier sitting on my server inside my screen.

5 thoughts on “I Hate FTP [en]

  1. Maybe if Mac OSX was finally allowing the use of FTP in the Finder, you’d see it another way?
    It’s working pretty darn well on my Ubuntu, I can browse and edit files through my FTP folders as I would on any other local folder…

    Apple… Wake up. Even Windows 98 was allowing this. 😉

  2. Screen rocks. I use it for teaching programming with the multiuser mode. Truly amazing. All I need now is a way of transferring software with full state information between screens.

    As for WordPress installations? You could do something similar with a deploy script – something like Fabric, Vlad the Deployer or Capistrano. Basically, you have username, password and server – then it checks to see if it can SSH in and do the various setup procedures, and if not, does similarly locally. It could then pop open text editor of your choice, let you edit the config file, and when you hit save, sync it. Automation makes life livable for geeks.

    But, still, SSH and screen – the full geek assimilation is taking place. Add Vim (or Emacs) and the membership criteria for the super nerd club will be complete. 😉

  3. I think I prefer the command-line — I even move to the terminal to deal with files on my computer when I’m doing serious spring-cleaning, rather than doing it in Finder. Simpler…

  4. @gagarine: Thanks for the tip. I don’t have Mac OSX, but I couldn’t find anything out of the box on it when I had to use it. I don’t think SSH was allowed on the server anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *