Skip to content

Instantly share code, notes, and snippets.

@drvenabili
Created April 8, 2016 09:55
Show Gist options
  • Save drvenabili/f77f0cf71fae03440bf66dae36bb31dc to your computer and use it in GitHub Desktop.
Save drvenabili/f77f0cf71fae03440bf66dae36bb31dc to your computer and use it in GitHub Desktop.
#!/bin/bash
date1=$(date +%Y-%m-%d)
date1="\"$date1 00:00:00\""
echo $date1
date2=$(date -d "1 week ago" +%Y-%m-%d)
date2="\"$date2 00:00:00\""
echo $date2
echo "SELECT "server_time", "piwik_log_action.name" AS "url" FROM "piwik_log_link_visit_action" JOIN "piwik_log_action" ON "piwik_log_link_visit_action.idaction_url" = "piwik_log_action.idaction" WHERE "idsite" =16 AND "server_time" > $date2 AND "server_time" < $date1 ORDER BY "server_time";" | mysql -u root -pljungan piwik2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment