Reducing the burden of updating Drupal modules

Update on Sep. 28, 2008: I will no longer update this script since Drush does this and much more.

Anyone who has used Drupal for some time knows how boring it is having to constantly update modules…

Donloading the updated module package with wget, deleting the old module directory, unpacking the new one, changing its permissions, repeat for all the other modules I want to update… and for those who don’t have SSH access to their sites, they have to do it via FTP or something similar, which is even worst. The update_status module does help but it only tells me that there are updates available for some of the modules I have installed - it doesn’t help me to actually update them.

I run a few Drupal-based websites, so I certainly feel the burden of this process and I thought I’d try to reduce it a little.

To that end, I created a little bash script that can be run on the server hosting the site to be updated and only requires me to tell it where to get the module from, something like:

sh update_modules.sh http://ftp.drupal.org/files/projects/spam-5.x-3.x-dev.tar.gz

The script will download the updated module package, remove the old directory, decompress the new file and set the updated directory permissions so that the webserver may access the files.

I’m publishing the script here under a Creative Commons Attribution-Share Alike 3.0 license, which basically means that anyone is free to use it as long as they give me credit for it and share any modifications to the script under the same license.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

Be the first to know when I post cool stuff

Subscribe to get my latest posts by email.

powered by TinyLetter