Changeset 9555
- Timestamp:
- Aug 24, 2011, 8:44:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/import_scan_data.sh
r9552 r9555 3 3 # Quick and dirty hack to import all data 4 4 5 if [ `id -un` != "www" ]; then 6 echo "ERROR, run as www user: sudo -E -u www $0" 7 exit 1 8 fi 5 9 6 DATAROOT="$HOME/scan-data" 7 MANAGE="$HOME/django_gheat/manage.py" 10 DATAROOT="/usr/local/var/scan-data" 11 MAP_CACHE=/usr/local/var/httpd/cache/maps 12 MANAGE="`dirname $0`/manage.py" 13 SSH_USER=backup 14 SSH_KEY="`dirname $0`/id_rsa" 15 export PYTHON_EGG_CACHE=/tmp/ 8 16 9 17 echo "# rsync webfolder" 10 rsync -az rvdzwet@tyan.wirelessleiden.nl:/usr/local/www/webfolder/scan-data/ $DATAROOT 18 rsync -e "ssh -i $SSH_KEY -l $SSH_USER -o StrictHostKeyChecking=no" -az tyan.wirelessleiden.nl:/usr/local/www/webfolder/scan-data/ $DATAROOT || exit 1 19 11 20 12 21 echo "# unzip compressed .tar.gz files" … … 18 27 done 19 28 29 ADDED=0 20 30 # Import all data 21 31 for USERDIR in `find $DATAROOT -depth 1 -type d`; do … … 32 42 for FILE in `find $DEVICEDIR -name 'ScanResult-*'`; do 33 43 $MANAGE import_droidstumbler $ARGS -m `basename $FILE` $FILE 44 if [ $? -eq 0 ]; then 45 ADDED=1 46 fi 34 47 done 35 48 done 36 49 done 37 50 38 # Clear cache 39 sudo -u www htcacheclean -l10K -p/usr/local/var/apache/cache/maps 51 if [ "$ADDED" -eq 1 ]; then 52 echo "# Clear cache $MAP_CACHE" 53 htcacheclean -l10K -p$MAP_CACHE 54 fi 40 55
Note:
See TracChangeset
for help on using the changeset viewer.