Index: /trunk/tools/czarclean.pl
===================================================================
--- /trunk/tools/czarclean.pl	(revision 29025)
+++ /trunk/tools/czarclean.pl	(revision 29025)
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+
+# local classes
+use czartool::CzarDb;
+
+my $czarDbName = undef;
+my $begin = undef;
+my $end = undef;
+my $interval = undef;
+my $verbose = undef;
+
+GetOptions (
+        "dbname|d=s" => \$czarDbName,
+        "interval|i=s" => \$interval,
+        "begin|b=s" => \$begin,
+        "end|e=s" => \$end,
+        "verbose|v" => \$verbose,
+        );
+
+print "\n*******************************************************************************\n";
+print "* \n";
+my $quit = 0;
+
+if (@ARGV) {
+    $quit=1;
+    print "* UNKNKOWN: option                          @ARGV\n";
+}
+if (!$begin) {
+    $quit=1;
+    print "* REQUIRED: choose a begin date             -b <datetime>                (default=7am this morning)\n";
+}
+if (!$end) {
+    $end=$begin;
+    print "* OPTIONAL: choose an end date              -e <datetime>                (default=$end)\n";
+}
+if (!$czarDbName) {
+    $czarDbName = "czardb";
+    print "* OPTIONAL: choose czar Db name             -d <name>                    (default=$czarDbName\n";
+}
+if (!$interval) {
+    $interval = "30 MINUTE";
+    print "* OPTIONAL: choose time interval            -i <'1 hour'|'2 hour'|etc>   (default=$interval)\n";
+}
+print "*\n*******************************************************************************\n";
+
+if ($quit) { exit; }
+
+
+my $save_temps = 0;
+
+
+my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
+
+my $labels = undef;
+
+
+$czarDb->cleanupDateRange($begin, $end, "1 HOUR");
+
