Human readable, sorted file sizes
A handy alias I use in my .bashrc when I'm trying to find large files/directories:
Script to download the latest Chromium build
An extremely simple script to download and install the latest build of chromium for mac:
Stick that in your crontab, and you're good to go!
Drupal multisite database backup
I'm currently in the middle of moving all my sites over to a new VPS, so I needed to quickly dump all the databases to migrate them. I had a script that handled drupal db dumps pretty well, but it didn't do multisite, so I threw this together:
- Copy that into something like "multisite_db_backup.sh"
- Change the "MYSQLDUMP_DIR" variable to wherever you want the sql dumps stored
- Move it somewhere within your PATH (I use ~/bin/)
- Make it executable (chmod +x multisite_db_backup.sh)
- Run it in the root directory of your drupal install (cd drupal6; ./multisite_db_backup.sh"
Tested on debian and Mac OS 10.5.
Automating update.php
I've been playing around with scripting update.php for a while now. I remember having a working script a few months back, but I never really put it into production and it looks like there's been some Drupal core changes that broke what I wrote before anyhow. I've rewritten most of it, and from what I can tell, it works pretty well for Drupal 6.
One of the main goals of any Drupal shell script that I write, is that it works on any Drupal installation, without bootstrapping. This is essential for me at work since we run a lot of individual Drupal installs. I'm transitioning over to drush to replace some of my scripts, but drush gets information about the site by bootstrapping. This makes a lot of sense for what it does, but it takes a bit more setting up, and isn't as portable as a vanilla bash script.
So with that in mind, here are a couple things to note about this script (and any other Drupal-relation shell script I post):