Index: trunk/ippScripts/scripts/ipp_cleanup.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 25837)
+++ trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 26549)
@@ -190,5 +190,6 @@
 	    # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
 	    my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
-	    $command = "$magicdstool -dbname gpc1  -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+	    $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+            $command .= " -dbname $dbname" if defined $dbname;
 	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 		run(command => $command, verbose => $verbose);
@@ -309,5 +310,6 @@
 	# Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
 	my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
-	$command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+	$command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+        $command .= " -dbname $dbname" if defined $dbname;
 	( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	    run(command => $command, verbose => $verbose);
@@ -444,5 +446,6 @@
 	    # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
 	    my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
-	    $command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+	    $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+            $command .= " -dbname $dbname" if defined $dbname;
 	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 		run(command => $command, verbose => $verbose);
@@ -580,5 +583,6 @@
 	    # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
 	    my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
-	    $command = "$magicdstool -dbname gpc1  -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+	    $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+            $command .= " -dbname $dbname" if defined $dbname;
 	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 		run(command => $command, verbose => $verbose);
@@ -732,5 +736,6 @@
 	    # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
 	    my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
-	    $command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+	    $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned";
+            $command .= " -dbname $dbname" if defined $dbname;
 	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 		run(command => $command, verbose => $verbose);
