Downloads helps me get big files into Tanzania. It’s been fun to write! Maybe you’ll be able to make use of it, too.
Overview
Since http downloads can be a little flaky over a slow connection, we take this basic approach:
-
Ssh to a server with a fast connection and download the file to a special directory there.
-
Later, rsync down the contents of that directory.
Beyond that, it’s all polish. There’s a nice interactive shell, smart (non-)use of the network, and good tab completion all around.
Sample Workflow
$ downloads add http://media.railscasts.com/videos/143_paypal_security.mov
$ downloads sync
receiving incremental file list
143_paypal_security.mov
229376 0% 7.86kB/s 0:50:27
...
$ downloads rm 143_paypal_security.mov
$
Installation
sudo gem install matthewtodd-downloads --source http://gems.github.com
Configuration
You can see your current configuration via the “config” command:
downloads config
To update these parameters, pass the key and the new value like so:
downloads config remote_host downloads.example.com
Commands
$ downloads help
add URL ...
attachments
config [KEY [VALUE]]
help [COMMAND]
ls
mv SOURCE TARGET
quit
rm FILE ...
shell
status
sync [kill]
Tips
-
downloads shell
re-uses the same ssh connection through your entire session, saving the re-connection overhead for every remote command. -
Tab completion is available for free in
downloads shell
. You can also get it at the command line thanks to Dr. Nic’s excellent TabTab gem, github.com/drnic/tabtab/tree/REL-0.9.1/PostInstall.txt. -
I use the following cron jobs to sync my downloads overnight. (Restarting
sync
every half hour helps recover from dropped connections.)*/30 0-5,22-23 * * * downloads sync 30 6 * * * downloads sync kill
-
I used to set up a GeekTool window showing the results of
downloads status
. (If you like, you can bottom-justify this text by piping it through gist.github.com/43363.) I’ve since written a similar tool called HeadsUp that you may appreciate: matthewtodd.github.com/heads_up. -
Install Downloads on your mail server, and you can set up a special email address, say
[email protected]
, that pipes all its messages throughdownloads attachments
. Currently, the messages will be dropped on the floor, but any attachments will be saved into your downloads folder, ready to be sync’ed down. -
I’ve been noodling with some applescripts. Check out the
resources
folder.