Using cron to update a site and prepare the backup

For a site on my VM I needed an svn sync and the backup files on my developer site.

I initially didn't want to install backup_migrate module. This was partly due to my arcane workflow which is of course by hand and unfamiliarity with back_migrate module.

So this is what I deviced

test_site@serverVM:~$ crontab -l
# m h  dom mon dow   command
*/7 * * * * wget -O - -q -t 1 http://test-site.com/cron.php
*/5 * * * * /home/test_site/svn-up 2>&1 > /home/test_site/svn-up.log
* */1 * * * /home/test_site/ant-backup 2>&1 > /home/test_site/ant-backup.log

Temporary Securing Drupal through Basic Auth in settings.php

We needed to protect our production site from prying eyes for a while with a basic authentication. Using apache basic auth settings seemed not enough. Or actually was too much. We wanted the theme to blend in. So these files were not supposed to get protected. Only our Drupal pages should.

The solution came from http://php.net/manual/en/features.http-auth.php. Adding the following to sites/default/settings.php makes the customer happy and drush too.

Dumping all tables with drush

I want a clean database without clicking.

echo "\
SELECT concat('drop table ', table_name, ';') \
  FROM information_schema.tables \
  WHERE table_schema=schema()" \
| `drush sql-connect` \
| grep "^drop table " \
| `drush sql-connect`

This work only for single drupal / single schema installs.

Drupal Jam 2010-03-19 Amsterdam

Updating drupal core

I never tried to do an core update on the command line. Today I tried it.

Get the latest drupal version

drush dl

Check your download

ls
drupal-6.x

Checkout svn drupal-6-core

svn --username=build2be chechout http(s)://my-svn/drupal-6-core/trunk/

Step into drupal version to update

cd trunk/www

Apply the patch

diff -ru ./ ../../drupal-6.x/ | patch -p0

Is this all?

nationalise your site with enlisted variables

With drupal we can enable the locale module and install the i18n module to internationalise and translate our site we can make our hands dirty by visiting the http://build2be.com/admin/build/translate/search.

Still our work is not finished yet. We have to dive into settings.php to translate more strings of our site.

Taken from http://drupal.org/node/275705#comment-1058360 and using http://drupal.org/projects/drush_sm we learn we may choose from a lot of variables.

Manage your sites with svn externals

After having worked with subversion for a while I finally got time to restructure my repository layouts. What I want is a simple way to update all the sites I maintain and I want those sites under version control.

Steps I took

  1. Make a drupal core repository
  2. Create your project repository
  3. Reference to the drupal core

Directory layout

In order to get a nice update-able project directory tree we choose a layout listed below.
www/
This contains only drupal core code will live.

Blog tools.

Searching on terms 'blog editor linux' I found these somewhat outdated links Five Desktop Blog Editors for GNU/Linux Users and Five More Desktop Blog Editors for GNU/Linux Users

Having a list is better then having zillions google links.

* GNOME Blog Entry Poster

* Drivel Journal Editor

* BloGTK Blog Editor

* ScribeFire Firefox Extension

Modules I have to check

Modules:

* dhtml_menu

* extlink

* pagination

Themes:

* waffles