[Rt-commit] rt branch, 4.4/shredder-no-sqldump-option, created. rt-4.4.4-105-g9f45adf8b7

? sunnavy sunnavy at bestpractical.com
Fri Apr 16 16:53:09 EDT 2021


The branch, 4.4/shredder-no-sqldump-option has been created
        at  9f45adf8b702ea4b14fe6d22314b49423c660bb8 (commit)

- Log -----------------------------------------------------------------
commit 9f45adf8b702ea4b14fe6d22314b49423c660bb8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 19 02:27:42 2020 +0800

    Add no-sqldump option to rt-shredder to avoid generating backups
    
    This is to speed up shredder and should be used only when necessary.

diff --git a/sbin/rt-shredder.in b/sbin/rt-shredder.in
index e924f38163..541ac13a26 100644
--- a/sbin/rt-shredder.in
+++ b/sbin/rt-shredder.in
@@ -80,6 +80,10 @@ after wiping out.
 By default creates files named F<< <ISO_date>-XXXX.sql >> in the current
 directory.
 
+=head2 --no-sqldump
+
+Don't generate the SQL dump.
+
 =head2 --object (DEPRECATED)
 
 Option has been deprecated, use plugin C<Objects> instead.
@@ -143,7 +147,7 @@ parse_args();
 
 my $shredder = RT::Shredder->new;
 
-{
+if ( !$opt{'no-sqldump'} ) {
     my $plugin = eval { $shredder->AddDumpPlugin( Arguments => {
         file_name    => $opt{'sqldump'},
         from_storage => 0,
@@ -242,6 +246,10 @@ sub parse_args
     if( GetOptions( 'sqldump=s' => \$tmp ) && $tmp ) {
         $opt{'sqldump'} = $tmp;
     }
+
+    if( GetOptions( 'no-sqldump' => \$tmp ) && $tmp ) {
+        $opt{'no-sqldump'} = $tmp;
+    }
     return;
 }
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list