mirror of https://github.com/BOINC/boinc.git
24 lines
550 B
Tcsh
Executable File
24 lines
550 B
Tcsh
Executable File
#! /bin/csh
|
|
|
|
# where is mysql located?
|
|
set MYSQL = /usr/local/mysql/bin/mysql
|
|
|
|
# what is the name of the database?
|
|
set DATABASE = mysql
|
|
|
|
# what is the name of the table you wish to count?
|
|
set TABLE = user
|
|
|
|
# tmpfile for sql
|
|
set TMPFILE = /tmp/count$$.sql
|
|
|
|
echo "use $DATABASE;" > $TMPFILE
|
|
echo "select count(*) from $TABLE;" >> $TMPFILE
|
|
|
|
set COUNT = `cat $TMPFILE | $MYSQL | /bin/tail -1`
|
|
|
|
set CIVDATE = `/bin/date "+%c:%m:%d:%H:%M" | awk '{print $5}'`
|
|
set UNIXDATE = `/usr/local/bin/perl -e 'print time()'`
|
|
|
|
echo $CIVDATE $UNIXDATE $COUNT
|