Last active
October 6, 2017 21:06
-
-
Save adam704a/7e5f9236fffd9b5947232b467e5c1ec6 to your computer and use it in GitHub Desktop.
export a sql view to s3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE_WITH_TIME=`date "+%Y%m%d"` | |
psql -h localhost dhis2 -c "\copy (SELECT * FROM _view_analytics) to './dhis2-export.tsv' WITH NULL AS ''" | |
aws s3 cp dhis2-export.csv s3://stoppalu-dhis2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment