source: trunk/id-mapper/run.sh @ 6

Last change on this file since 6 was 6, checked in by rob.hooft@…, 6 years ago

first cut at the pmid2doi upfdater

  • Property svn:executable set to *
File size: 563 bytes
Line 
1#!/bin/bash
2exec >> run.err 2>&1
3while /bin/true
4do
5  f=run.log-`date +"%Y%m%d-%H%M"`
6  python pmid2doi-mapper.py > $f 2>&1 &
7  # Count 6 times to 30 minutes, totalling 3 hours
8  for count in {1..6}
9  do
10    sleep 1800
11    # See if the output file has changed in those 30 minutes
12    mods=`find $f -mmin -30 | wc -l`
13    # If it hasn't, then exit prematurely
14    if [ $mods = 0 ]; then break; fi
15  done
16  # Kill the currently running job, to be able to start a new one
17  # Using %? makes sure any remaining running jobs are killed
18  killall python || exit 1
19done
Note: See TracBrowser for help on using the repository browser.