Problems with RTx::Shredder!

Hello!

I’m running RT3.0.11 on a debian sarge box. Now I installed
RTx::Shredder v0.01. But the “demo” programm, don’t work :frowning:

#!/usr/bin/perl

use lib “/usr/share/request-tracker3/lib”;

use RTx::Shredder;

RTx::Shredder::Init();
my $deleted = RT::Tickets->new( $RT::SystemUser );
$deleted->{‘allow_deleted_search’} = 1;
$deleted->Limit( VALUE => ‘deleted’ );
print “Start wipeout\n”;
while( my $t = $deleted->Next ) {
print “.”;
$t->Wipeout;
}
print “\nEnded\n”;

gives me:

rt3:~# ./purge_dead_with_shredder.pl
Start wipeout
[Wed Sep 8 15:00:18 2004] [error]: RestrictionsToClauses: I don’t know
about yet at /usr/share/request-tracker3/lib/RT/Tickets_Overlay.pm line
1984.
(/usr/share/request-tracker3/lib/RT/Tickets_Overlay.pm:2064)

Ended
<<

best regards!

Hello, Sven.
Hmmm. As I see users a little bit confused with my distribution :frowning:

Did you see rtx-shredder script? It should be installed with
RTx::Shredder under /path/to/rt3/local/sbin path.

RTx::Shredder currently is more API then end-user tool. For end-user
there is two scripts rtx-shredder and rtx-validator. Both under
’local/sbin’.

I’ll try to update docs to be more clear on this topic in next release.

				Best regards. Ruslan.

PS: See also comment below about your error.

Sven Sternberger wrote:

Hello!

I’m running RT3.0.11 on a debian sarge box. Now I installed
RTx::Shredder v0.01. But the “demo” programm, don’t work :frowning:

#!/usr/bin/perl

use lib “/usr/share/request-tracker3/lib”;

use RTx::Shredder;

RTx::Shredder::Init();
my $deleted = RT::Tickets->new( $RT::SystemUser );
$deleted->{‘allow_deleted_search’} = 1;
$deleted->Limit( VALUE => ‘deleted’ );

You forgot “FIELD => ‘Status’” here.

Did you install the patch as well?On Wed, Sep 08, 2004 at 04:59:30PM +0200, Sven Sternberger wrote:

Hello!

I’m running RT3.0.11 on a debian sarge box. Now I installed
RTx::Shredder v0.01. But the “demo” programm, don’t work :frowning:

#!/usr/bin/perl

use lib “/usr/share/request-tracker3/lib”;

use RTx::Shredder;

RTx::Shredder::Init();
my $deleted = RT::Tickets->new( $RT::SystemUser );
$deleted->{‘allow_deleted_search’} = 1;
$deleted->Limit( VALUE => ‘deleted’ );
print “Start wipeout\n”;
while( my $t = $deleted->Next ) {
print “.”;
$t->Wipeout;
}
print “\nEnded\n”;

gives me:

rt3:~# ./purge_dead_with_shredder.pl
Start wipeout
[Wed Sep 8 15:00:18 2004] [error]: RestrictionsToClauses: I don’t know
about yet at /usr/share/request-tracker3/lib/RT/Tickets_Overlay.pm line
1984.
(/usr/share/request-tracker3/lib/RT/Tickets_Overlay.pm:2064)

Ended
<<

best regards!


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Hi Ruslan!

first thanks for your help and the script. we really needed
such a tool, because our database will probably reach
2gig at the end of the year.

Hmmm. As I see users a little bit confused with my distribution :frowning:

You are right, it’s your fault :wink:
my proposals
1.) Correct the example script
http://search.cpan.org/~ruz/RTx-Shredder-0.01/lib/RTx/Shredder.pm
-$deleted->Limit( VALUE => ‘deleted’ );
+$deleted->LimitStatus( VALUE => ‘deleted’ );
2.) Note the installed scripts in README
3.) Note that it is >> necessary << to install the patch. (So this
was my second fault/thank you Todd). For our absolute beginners the
"patch -p0 …" line
4.) Some hints for users of the debian distribution, because some path
are different, so I had to modify the Makefile to get the installer
work.

and a question isn’t it possible to put all the affected files
in the local tree? so i don’t have to touch the files of the
distribution

best regards

sven

Sven Sternberger wrote:

Hi Ruslan!

first thanks for your help and the script. we really needed
such a tool, because our database will probably reach
2gig at the end of the year.

Hmmm. As I see users a little bit confused with my distribution :frowning:

You are right, it’s your fault :wink:
my proposals
1.) Correct the example script
http://search.cpan.org/~ruz/RTx-Shredder-0.01/lib/RTx/Shredder.pm
-$deleted->Limit( VALUE => ‘deleted’ );
+$deleted->LimitStatus( VALUE => ‘deleted’ );
Oops, my fault. I’ll fix it.

2.) Note the installed scripts in README
ok.

3.) Note that it is >> necessary << to install the patch. (So this
was my second fault/thank you Todd). For our absolute beginners the
"patch -p0 …" line
ok.

4.) Some hints for users of the debian distribution, because some path
are different, so I had to modify the Makefile to get the installer
work.
I use Module::Install::RTx and I thought that it gets file pathes from
current RT instance.
Please, send me output from perl Makefile.PL
For me it’s:
sudo perl Makefile.PL
Using RT configurations from /opt/rt3/lib/RT.pm:
./lib => /opt/rt3/local/lib
./sbin => /opt/rt3/local/sbin

You should have different output.

and a question isn’t it possible to put all the affected files
in the local tree? so i don’t have to touch the files of the
distribution
This patch was discussed with Jesse and should be accepted to 3.0.12 and
3.2.2 without changes. So patch is attached only while RT doesn’t
support searches on deleted tickets.

Hi Ruslan!

4.) Some hints for users of the debian distribution, because some path
are different, so I had to modify the Makefile to get the installer
work.

I use Module::Install::RTx and I thought that it gets file pathes from
current RT instance.
Please, send me output from perl Makefile.PL

this are the result on a untweaked debian:
Using RT configurations from /usr/share/request-tracker3/lib/RT.pm:
./lib => /usr/local/share/request-tracker3/lib
./sbin => /usr/local/share/request-tracker3/sbin
configure: creating ./config.status
config.status: creating sbin/rtx-shredder
config.status: creating sbin/rtx-validator
config.status: creating lib/RTx/Shredder.pm
Writing Makefile for RTx::Shredder

okay what seems to be not okay is in Makefile
SITEPREFIX = $(PREFIX)/local (Makefile)
SITEPREFIX = /usr/local/share/request-tracker3 (debian)

and the rt sbin dir is under debian in:
/usr/sbin

but sorry yesterday I also installed ExtractCustomFieldValues
which failed due to a wrong path to rt-setup-database. so
in the case of shredder it is minor important. it worked out
of the box.

best regards (and thanks for 6500 wiped out tickets :slight_smile:

sven

Sven Sternberger wrote:

Hi Ruslan!

4.) Some hints for users of the debian distribution, because some path
are different, so I had to modify the Makefile to get the installer
work.

I use Module::Install::RTx and I thought that it gets file pathes from
current RT instance.
Please, send me output from perl Makefile.PL

this are the result on a untweaked debian:
Using RT configurations from /usr/share/request-tracker3/lib/RT.pm:
./lib => /usr/local/share/request-tracker3/lib
./sbin => /usr/local/share/request-tracker3/sbin
configure: creating ./config.status
config.status: creating sbin/rtx-shredder
config.status: creating sbin/rtx-validator
config.status: creating lib/RTx/Shredder.pm
Writing Makefile for RTx::Shredder

okay what seems to be not okay is in Makefile
SITEPREFIX = $(PREFIX)/local (Makefile)
SITEPREFIX = /usr/local/share/request-tracker3 (debian)

and the rt sbin dir is under debian in:
/usr/sbin
RT has main(core) dirs and also local dirs(for overriding).
RTx::Shredder must be installed under local dirs.

:frowning: I realize that I can’t take it from RT.pm so can’t guess where local
sbin dir is :frowning: nor main.

but sorry yesterday I also installed ExtractCustomFieldValues
which failed due to a wrong path to rt-setup-database. so
in the case of shredder it is minor important. it worked out
of the box.

best regards (and thanks for 6500 wiped out tickets :slight_smile:
Glad to hear that Shredder do its job.