Skip to content

Instantly share code, notes, and snippets.

@marciuz
Created December 22, 2017 10:06
Show Gist options
  • Save marciuz/80770b65baf080f0cc3f399e4a175862 to your computer and use it in GitHub Desktop.
Save marciuz/80770b65baf080f0cc3f399e4a175862 to your computer and use it in GitHub Desktop.
Script per l'harvesting di Dati.gov.it
#!/bin/sh
# File harvest.sh
# Esegue l'harvest del parametro $1, inviato come argomento
# Il parametro è del tipo "dati_trentino", cioè il machine name di DKAN.
#
# Ultima modifica: 08/05/2017 - <marcelloverona@gmail.com>
#
# document root di DKAN
DOCROOT_DATIGOV=/var/www/datigovit/webroot
# Indice di Search API per i dataset
SAPI_INDEX=2
# Entra nella directory di Dati.Gov.it
cd $DOCROOT_DATIGOV
if [ -z "$1" ]
then
echo "Nessun machine name indicato." && exit
fi
# Esegui Cache & migrate
sudo -u www-data drush dkan-h $1
# Aggiorna il file con l'elenco dei dataset
sudo -u www-data drush odsm-filecache ckan_package_list
# Forza l'indicizzazione
sudo -u www-data drush sapi-i $SAPI_INDEX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment