Bash script example for custom services action with session authentification

Here is Bash script example how to work with custom services action that requires session authentification.

Endpoint requirements :

  • Set "Authentification" as "Session authentication"
  • Set "Response formatters" as "json"

Tools for upgrading themes

This page is a stub for collating automated theme upgrade steps.

You'll want to run these sed commands over (the copy of) your old d6 themes and then do a diff to make sure nothing is broken.

Please edit this page to refine the steps you have taken.

Simple wget multisite cron, lazy method

I just wrote this script for running the crons on all my drupal sites before I discovered this section in the documentation. This works well for me because I'm lazy and I don't have to maintain a list of my drupal sites somewhere for it to run all my crons. The script simply reads the domains from my sites folder. It works well for me, but I think it might not work for every situation, ymmv.

Create an executable called drupalcron:

Multisite cron without wget/curl


#!/usr/bin/php5
<?php
/**
* This script scans the sites directory, and uses a regular expression to extract the sitenames.
* It then uses this sitename to execute the cronjob for these sites.
* You then only have to create one cronjob for this script.
* In this way, you can create and delete sites on the fly, but all their cronjobs will be executed.
*/
/*
* Carl van Denzen, june 2009:
* Options for this script:
* -h (p.e. arjan.vandenzen.nl)
* -r (p.e. .+\.vandenzen\.nl) This will be used in most cases.
* -a
*
* When this script is invoked with parameter -r, then it will call
* itself for every host in the sites directory that matches the -r regexp.
* These calls will be with the -h argument set to the site name.
*
* When invoked with -h option (only ONE is allowed), it will run cron
* for the named hostname site.
*
* When this script is invoked without parameters, it will die. This is to avoid
* runaway scripts.
*
* Purpose of this behaviour:
*
* You can add this script to your crontab with parameter -a: it will run
* for every site found in the drupal sites directory. This is the regular
* drupal/cron.php behaviour.
* In a one-site set-up it will only run for the default directory.
* In a multi-site set-up it will run for all sites (beware of the default directory?)
*

Multi-site Cron Bash Script

A quick bash script to run cron for multiple sites:

#!/bin/bash
## Define your websites in an array
sites=(example.com example2.com example3.com)
len=${#sites[*]}
for((i=0; i<$len; i++)); do
        wget -q http://${sites[${i}]}/cron.php
        # You may remove (or comment) the following line if you
        # wish to retain the downloaded file.
        rm cron.php
done

Pages

Subscribe with RSS Subscribe to RSS - bash