Commit 7c1e3600 authored by cividesk's avatar cividesk

Added daily update shell script to the repository (was previously independent).

parent 7f1ddd5f
......@@ -18,7 +18,8 @@ This is done by the 'generate.php' script in the project root. This file will co
# Other considerations
You should run composer to download the project dependencies.
The project file 'config.php' is not published as it contains sensitive data.
civicrm-statistics.sh encapsulates all that is needed to update the statistics, run it daily with a cron job.
The project file 'config.php' is not published as it contains sensitive data. Adapt from the template file.
Each subdirectory might also contain:
- a 'db_create.sql' for creating the tables it needs in the database
- a 'refs' folder with links and/or documentation that helped in the development
\ No newline at end of file
#! /bin/bash
DEST=/var/www/stats.civicrm.org/public/
# For the log file
echo "--- CiviCRM Statistics run on `date` ---"
# Change to the directory this script is in
cd "$(dirname $(readlink -f $0))"
# Refresh data for each of the defined sources
for DIR in *; do
if [ -d $DIR ] && [ -f $DIR/getdata.php ]; then
pushd $DIR > /dev/null
php getdata.php
popd > /dev/null
fi
done
# Regenerate statistics and push to destination
php generate.php
rsync -a json/ $DEST
# For the log file
echo --- Done ---
echo
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment