Mercurial > hg > LGDataverses
comparison scripts/api/download/dbquery @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 9:5926d6419569 | 10:a50cf11e5178 |
|---|---|
| 1 #!/bin/sh | |
| 2 if [ -z "$1" ]; then | |
| 3 echo "No start date in YYYY-MM-DD format provided." | |
| 4 exit 1 | |
| 5 else | |
| 6 if [ -z "$2" ]; then | |
| 7 echo "No end date in YYYY-MM-DD format provided." | |
| 8 exit 1 | |
| 9 fi | |
| 10 START_DATE=$1 | |
| 11 END_DATE=$2 | |
| 12 fi | |
| 13 psql -h $DB_SERVER -U $DB_USER -p $DB_PORT $DB_NAME -F $'\t' --no-align --pset footer -c "select dvobject.id, dvobject.createdate, dvobject.owner_id, datafile.* from dvobject, datafile where dvobject.id=datafile.id and dvobject.dtype='DataFile' and dvobject.createdate>to_date('$START_DATE','YYYY-MM-DD') and dvobject.createdate<to_date('$END_DATE','YYYY-MM-DD') order by dvobject.createdate asc;" > files.tsv |
