Gitlab Community Edition Instance

Commit 6566c879 authored by Bjoern Nachtwey's avatar Bjoern Nachtwey
Browse files

identify and remove duplicate entries with SUN and SUY keeping SUN if both are given

parent 94d07b9f
......@@ -65,6 +65,7 @@
# 2020-02-06 0.6.8 encapsulate escaping of special characters for non-windows systems
# 2020-02-12 0.6.8.1 add trailing "*" to backup path for windows again
# 2021-07-14 0.6.8.2 changed names of log files, adding "dsmci"
# 2021-07-15 0.6.9 identify and remove duplicate entries with "SUN" and "SUY" keeping "SUN" if both are given
#
# important notes
#
......@@ -349,7 +350,9 @@ $starttimestring = sprintf "%d-%2.2d-%2.2d %2.2d:%2.2d", $year+1900, $mon+1, $md
###############################################################################
###############################################################################
#
# find all folders below $startpath and seperate for processing with "su=n" or "su=y"
#
###############################################################################
foreach $actpath (@startpaths)
......@@ -385,7 +388,37 @@ foreach $actpath (@startpaths)
shift @allpaths;
###############################################################################
#
# eliminate redundant entries from folderlist, keeping SUN if also SUY given
#
###############################################################################
# sort list to put "similar" entries next together
my @sortlist = sort @allpaths;
# undef @allpaths, list will be recreated when after duplicates are removed
undef @allpaths;
# look for duplicate entries
# => this also reduces all entries to just one entity with SUN and SUY
my %seen;
foreach $item (@sortlist)
{
# assuming SUN is sorted upwards of SUY, the SUN entry is first, therefore referencing the first entry only
$actpath = substr $item, 0, -2;
if (! $seen{$actpath} )
{
push @allpaths, $item;
$seen{$actpath} = 1;
}
}
###############################################################################
#
# read profiling
#
###############################################################################
$proffilename = File::Spec->canonpath("dsmci".$profapx);
......@@ -399,7 +432,6 @@ $proffilename = File::Spec->canonpath("dsmci".$profapx);
###############################################################################
###############################################################################
#
# start loop on all folders
#
......@@ -411,6 +443,13 @@ $dircount = 0; # counter of dirs already processed
open $GLOBALLOGFILE, ">>", $globallog_filename;
printf $GLOBALLOGFILE "Number of Threads: %d\n\n", $numdir;
close $GLOBALLOGFILE;
###############################################################################
#
# do the parallel backup
#
###############################################################################
fork_backup_threads(\@allpaths);
# wait for all child threads exiting
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment