]> jfr.im git - irc/thales.git/commitdiff
crontab moved to tools/
authorlnu <lnu>
Sat, 5 Jul 2003 19:44:49 +0000 (19:44 +0000)
committerlnu <lnu>
Sat, 5 Jul 2003 19:44:49 +0000 (19:44 +0000)
contrib/Crontab/cron.sh [deleted file]
tools/README [new file with mode: 0644]
tools/crontab/cron.sh [new file with mode: 0755]

diff --git a/contrib/Crontab/cron.sh b/contrib/Crontab/cron.sh
deleted file mode 100755 (executable)
index 3a61b2c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-
-# Thales CRONTAB script
-# Written by Jollino <jollino@sogno.net>
-# Improved by Lucas <lucas@lucas-nussbaum.net>
-
-# CONFIGURATION
-
-thales_dir='/home/lucas/thales'
-# you might want to add the -v parameter to generate more output
-thales_exec='./thales'
-thales_pid='thales.pid'
-thales_log='thales.log'
-
-# SCRIPT
-
-cd $thales_dir
-if [ -f $thales_pid ]; then
-       pid=`cat $thales_pid`
-       if [ `ps -p $pid | wc -l` -eq 2 ]; then
-               exit
-       else
-               echo "Pidfile was stale."
-       fi
-fi
-
-echo "Looks like Thales died... let's relaunch it"
-backuplogname=$thales_log.`date '+%s'`
-mv $thales_log $backuplogname
-gzip $backuplogname
-$thales_exec
diff --git a/tools/README b/tools/README
new file mode 100644 (file)
index 0000000..a17f045
--- /dev/null
@@ -0,0 +1,3 @@
+This directory contains scripts that might be useful if you are using Thales.
+For scripts using Thales' database to retrieve interesting information, see
+the examples/ directory.
diff --git a/tools/crontab/cron.sh b/tools/crontab/cron.sh
new file mode 100755 (executable)
index 0000000..17fdf89
--- /dev/null
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Thales crontab script
+# Copyright (C) 2002 Daniele Nicolucci <jollino@sogno.net>
+# Copyright (C) 2002 Lucas Nussbaum <lucas@lucas-nussbaum.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# Written by Jollino <jollino@sogno.net>
+# Improved by Lucas <lucas@lucas-nussbaum.net>
+
+# CONFIGURATION
+
+thales_dir='/home/lucas/thales'
+# you might want to add the -v parameter to generate more output
+thales_exec='./thales'
+thales_pid='thales.pid'
+thales_log='thales.log'
+
+# SCRIPT
+
+cd $thales_dir
+if [ -f $thales_pid ]; then
+       pid=`cat $thales_pid`
+       if [ `ps -p $pid | wc -l` -eq 2 ]; then
+               exit
+       else
+               echo "Pidfile was stale."
+       fi
+fi
+
+echo "Looks like Thales died... let's relaunch it"
+backuplogname=$thales_log.`date '+%s'`
+mv $thales_log $backuplogname
+gzip $backuplogname
+$thales_exec