Skip to content

Commit

Permalink
A script for automated crawling
Browse files Browse the repository at this point in the history
  • Loading branch information
pde committed Sep 29, 2012
1 parent 28d4699 commit 17244a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions code/robocrawl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
#
# Run and commit a crawl, merging the results into the local "data" branch
#
# Unfortunately this doesn't work in cron unless without a patch for
# http://stackoverflow.com/questions/4399617/python-os-getlogin-problem
#
CRAWLER_CHECKOUT=~/tosback2_real_crawls/
set -x
cd $CRAWLER_CHECKOUT
git checkout --force data
python code/crawl.py > crawl.log
TAG=`grep "Committing results to" crawl.log | cut -d" " -f 4`
if [ "$TAG" != "" ] ; then
git checkout --force "$TAG" || exit 1
git merge -s ours data || exit 1
git checkout --force data || exit 1
git merge "$TAG"
fi

0 comments on commit 17244a3

Please sign in to comment.