[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1800] updated user script to only dump users who have
From: |
Matt Lee |
Subject: |
[Librefm-commits] [1800] updated user script to only dump users who have a flag set, also dump anonymized scrobbling data |
Date: |
Sun, 24 May 2009 17:02:04 +0000 |
Revision: 1800
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1800
Author: mattl
Date: 2009-05-24 17:02:04 +0000 (Sun, 24 May 2009)
Log Message:
-----------
updated user script to only dump users who have a flag set, also dump
anonymized scrobbling data
Modified Paths:
--------------
trunk/scripts/users_dump.sh
Modified: trunk/scripts/users_dump.sh
===================================================================
--- trunk/scripts/users_dump.sh 2009-05-24 16:53:41 UTC (rev 1799)
+++ trunk/scripts/users_dump.sh 2009-05-24 17:02:04 UTC (rev 1800)
@@ -1,6 +1,6 @@
#!/bin/sh
-cd /home/librefm/turtle/data/wip || exit 1
+cd /home/librefm/wip || exit 1
if [ -x /usr/bin/lockfile-create ]; then
lockfile-create /var/lock/gnukebox-userdump.lock
@@ -11,7 +11,7 @@
fi
#we rely on lack of whitespace here
-LIST=$(echo "SELECT DISTINCT username FROM Users;" | psql -q -t)
+LIST=$(echo "SELECT DISTINCT username FROM Users where public_export = 1;" |
psql -q -t)
for I in $LIST; do
@@ -19,9 +19,13 @@
echo 'COPY (SELECT * FROM Scrobbles where username='"'$I'"') TO STDOUT
WITH CSV HEADER;' | psql -q >> $I.text.utf8
- mv -- $I.text.utf8 /home/librefm/turtle/data/
+ mv -- $I.text.utf8 /home/librefm/turtle/data/users/
done
+ echo 'COPY (SELECT Artist,Track,Album from Scrobbles) TO STDOUT WITH CSV
HEADER;' | psql -q >> 'anonymous'
+
+ mv anonymous /home/librefm/turtle/data/
+
if [ -x /usr/bin/lockfile-create ]; then
kill "${LOCKER}"
lockfile-remove /var/lock/gnukebox-userdump.lock
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1800] updated user script to only dump users who have a flag set, also dump anonymized scrobbling data,
Matt Lee <=