librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1133] user dump locking if lockfile-progs is installe


From: Clint Adams
Subject: [Librefm-commits] [1133] user dump locking if lockfile-progs is installed
Date: Sat, 02 May 2009 19:46:43 +0000

Revision: 1133
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1133
Author:   clint
Date:     2009-05-02 19:46:42 +0000 (Sat, 02 May 2009)
Log Message:
-----------
user dump locking if lockfile-progs is installed

Modified Paths:
--------------
    trunk/scripts/users_dump.sh

Modified: trunk/scripts/users_dump.sh
===================================================================
--- trunk/scripts/users_dump.sh 2009-05-02 18:52:14 UTC (rev 1132)
+++ trunk/scripts/users_dump.sh 2009-05-02 19:46:42 UTC (rev 1133)
@@ -2,6 +2,14 @@
 
 cd /home/librefm/turtle/data/wip || exit 1
 
+if [ -x /usr/bin/lockfile-create ]; then
+       lockfile-create /var/lock/gnukebox-userdump.lock
+       lockfile-touch /var/lock/gnukebox-userdump.lock &
+       LOCKER="$!"
+else
+       echo >&2 "Running without locking."
+fi
+
 #we rely on lack of whitespace here
 LIST=$(echo "SELECT DISTINCT username FROM Users;" | psql -q -t)
 
@@ -13,3 +21,8 @@
 
     mv -- $I.text.utf8 /home/librefm/turtle/data/
 done
+
+if [ -x /usr/bin/lockfile-create ]; then
+       kill "${LOCKER}"
+       lockfile-remove /var/lock/gnukebox-userdump.lock
+fi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]