Addshore has submitted this change and it was merged.

Change subject: Add sql to tsv script
......................................................................


Add sql to tsv script

Change-Id: Iceea297884f5f7cd3b7ae60a8146cd9fd66ed445
---
M cron
A export.sh
2 files changed, 13 insertions(+), 1 deletion(-)

Approvals:
  Addshore: Verified; Looks good to me, approved



diff --git a/cron b/cron
index 1b98956..b9a3758 100644
--- a/cron
+++ b/cron
@@ -4,4 +4,6 @@
 0 12 * * * ~/src/wikidata_getclaims_property_use.sh
 #This doesn't matter when it runs....
 0 6 * * * ~/src/wikidata_site_stats.sh
-0 6 * * * php ~/src/wikidata_social.php
\ No newline at end of file
+0 6 * * * php ~/src/wikidata_social.php
+#Create the tsv files twice daily...
+30 6,12 * * * ~/src/export.sh
\ No newline at end of file
diff --git a/export.sh b/export.sh
new file mode 100644
index 0000000..6fc563b
--- /dev/null
+++ b/export.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+#Simple script to create tsv files from the tables used
+
+mysqldefaults="/etc/mysql/conf.d/analytics-research-client.cnf"
+mysqlhost="analytics-store.eqiad.wmnet"
+
+mysql --defaults-file=$mysqldefaults -h $mysqlhost -e "SELECT * FROM 
staging.wikidata_social" > wikidata_social.tsv
+mysql --defaults-file=$mysqldefaults -h $mysqlhost -e "SELECT * FROM 
staging.wikidata_site_stats" > wikidata_site_stats.tsv
+mysql --defaults-file=$mysqldefaults -h $mysqlhost -e "SELECT * FROM 
staging.wikidata_getclaims_property_use" > wikidata_getclaims_property_use.tsv
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/240724
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iceea297884f5f7cd3b7ae60a8146cd9fd66ed445
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-wikidata-data
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: JanZerebecki <jan.wikime...@zerebecki.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to