unser OTRS macht jeden Abend ein automatisches Backup über das backup.pl script. Ich möchte die Anzahl der Backups die gespeichert werden auf 2 Backups begrenzen.
Kann mir jemand sagen wo ich das einstellen kann?
Ich vermute irgendwo hier im backup.pl script:
Code: Select all
# remove old backups
if ( $Opts{r} ) {
my %LeaveBackups;
my ( $Year, $Month, $Day ) = Today_and_Now();
for ( 0 .. $Opts{r} ) {
my ( $DYear, $DMonth, $DDay ) = Add_Delta_Days( $Year, $Month, $Day, -$_ );
$LeaveBackups{ sprintf( "%04d-%01d-%01d", $DYear, $DMonth, $DDay ) } = 1;
$LeaveBackups{ sprintf( "%04d-%02d-%01d", $DYear, $DMonth, $DDay ) } = 1;
$LeaveBackups{ sprintf( "%04d-%01d-%02d", $DYear, $DMonth, $DDay ) } = 1;
$LeaveBackups{ sprintf( "%04d-%02d-%02d", $DYear, $DMonth, $DDay ) } = 1;
}
my @Directories = $CommonObject{MainObject}->DirectoryRead(
Directory => $Opts{d},
Filter => '*',
);
for my $Directory (@Directories) {
my $Leave = 0;
for my $Data ( keys %LeaveBackups ) {
if ( $Directory =~ m/$Data/ ) {
$Leave = 1;
}
}
if ( !$Leave ) {
# remove files and directory
print "deleting old backup in $Directory ... ";
my @Files = $CommonObject{MainObject}->DirectoryRead(
Directory => $Directory,
Filter => '*',
);
for my $File (@Files) {
if ( -e $File ) {
# print "Notice: remove $File\n";
unlink $File;
}
}
if ( rmdir($Directory) ) {
print "done\n";
}
else {
print "failed\n";
}
}
}
}