Skip to content

Commit c5551fc

Browse files
author
Marcin Przepiorowski
committed
Merge branch 'exclude' into develop
2 parents b16e623 + ef43d5b commit c5551fc

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed

bin/dx_ctl_dsource.pl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
'logsyncmode=s' => \(my $logsyncmode),
7373
'validatedsync=s' => \(my $validatedsync),
7474
'delphixmanaged=s' => \(my $delphixmanaged),
75+
'exclude=s@' => \(my $exclude),
7576
'hadr=s' => \(my $hadr),
7677
'compression=s' => \($compression),
7778
'type=s' => \(my $type),
@@ -339,7 +340,7 @@
339340
}
340341
elsif ($type eq 'vFiles') {
341342
my $db = new AppDataVDB_obj($engine_obj,$debug);
342-
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dsourcename,$group);
343+
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dsourcename,$group, $exclude);
343344
}
344345
elsif ($type eq 'db2') {
345346
my $db = new DB2VDB_obj($engine_obj,$debug);
@@ -386,6 +387,7 @@ =head1 SYNOPSIS
386387
[-delphixmanaged yes/no ]
387388
[-dbusertype database|environment|domain]
388389
[-cdbcont container -cdbuser user -cdbpass password]
390+
[-exclude path]
389391
[-debug ]
390392
[-version ]
391393
[-help|? ]
@@ -512,6 +514,9 @@ =head2 dSource arguments
512514
ex.
513515
hadrPrimarySVC:50001,hadrPrimaryHostname:marcindb2src.dcenter,hadrStandbySVC:50011,hadrTargetList:marcindb2src.dcenter:50001
514516
517+
=item B<-exclude path>
518+
Exclude path for vFiles dSources
519+
515520
516521
=back
517522
@@ -603,6 +608,14 @@ =head1 EXAMPLES
603608
Waiting for all actions to complete. Parent action is ACTION-1879
604609
Action completed with success
605610
611+
612+
Adding a vFiles dSource
613+
614+
dx_ctl_dsource -d test -action create -group "Untitled" -creategroup -dsourcename "vtest" -type vFiles -sourcename "vtest" -sourceinst "Unstructured Files" \
615+
-sourceenv "marcintgt" -source_os_user "delphix" -exclude "dir1/dir2" -exclude "dir3"
616+
Waiting for all actions to complete. Parent action is ACTION-2919
617+
Action completed with success
618+
606619
Updating a backup path and validated sync mode for Sybase
607620
608621
dx_ctl_dsource -d Landshark5 -action update -validatedsync ENABLED -backup_dir "/u02/sybase_back" -dsourcename pubs3

lib/AppDataVDB_obj.pm

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,20 @@ sub getdSourceBackup
134134

135135
my $osuser = $self->getOSUser();
136136

137+
my $exludes = $self->getExludelist();
138+
137139
$restore_args = "dx_ctl_dsource$suffix -d $engine -action create -group \"$groupname\" -creategroup ";
138140
$restore_args = $restore_args . "-dsourcename \"$dbn\" -type $vendor -sourcename \"$dbhostname\" ";
139141
$restore_args = $restore_args . "-sourceinst \"$rephome\" -sourceenv \"" . $self->getEnvironmentName() . "\" -source_os_user \"$osuser\" ";
140142

143+
if (scalar(@{$exludes}) > 0) {
144+
$exclude_str = '';
145+
for my $i (@{$exludes}) {
146+
$exclude_str = $exclude_str . "-exclude \"" . $i . "\" ";
147+
}
148+
$restore_args = $restore_args . $exclude_str;
149+
}
150+
141151
$output->addLine(
142152
$restore_args
143153
);
@@ -374,6 +384,7 @@ sub createVDB {
374384
# - source_osuser - name of source OS user
375385
# - dsource_name - name of dsource in environment
376386
# - group - dsource group
387+
# - exclude - exclude list
377388
# Start job to add AppData dSource
378389
# all above parameters are required. Additional parameters should by set by setXXXX procedures before this one is called
379390
# Return job number if provisioning has been started, otherwise return undef
@@ -386,6 +397,7 @@ sub addSource {
386397
my $source_osuser = shift;
387398
my $dsource_name = shift;
388399
my $group = shift;
400+
my $exclude = shift;
389401

390402

391403
logger($self->{_debug}, "Entering AppDataVDB_obj::addSource",1);
@@ -412,7 +424,7 @@ sub addSource {
412424
}
413425

414426
my @followarray;
415-
my @excludes;
427+
#my @excludes;
416428
my %dsource_params;
417429

418430
if (version->parse($self->{_dlpxObject}->getApi()) < version->parse(1.8.0)) {
@@ -427,7 +439,7 @@ sub addSource {
427439
"source" => {
428440
"type" => "AppDataLinkedDirectSource",
429441
"config" => $config->{reference},
430-
"excludes" => \@excludes,
442+
"excludes" => $exclude,
431443
"followSymlinks" => \@followarray
432444
},
433445
"environmentUser" => $source_os_ref
@@ -446,7 +458,7 @@ sub addSource {
446458
"type" => "AppDataDirectLinkData",
447459
"config" => $config->{reference},
448460
"environmentUser" => $source_os_ref,
449-
"excludes" => \@excludes,
461+
"excludes" => $exclude,
450462
"followSymlinks" => \@followarray,
451463
"parameters" => {}
452464
}
@@ -461,7 +473,7 @@ sub addSource {
461473
"type" => "AppDataDirectLinkData",
462474
"config" => $config->{reference},
463475
"environmentUser" => $source_os_ref,
464-
"excludes" => \@excludes,
476+
"excludes" => $exclude,
465477
"followSymlinks" => \@followarray,
466478
"parameters" => {},
467479
"syncParameters" => {
@@ -502,6 +514,20 @@ sub setName {
502514

503515
}
504516

517+
518+
# Procedure getExludelist
519+
# parameters: none
520+
# Return an array with combained list of excludes
521+
522+
sub getExludelist
523+
{
524+
my $self = shift;
525+
logger($self->{_debug}, "Entering AppDataVDB_obj::getExludelist",1);
526+
my $exludearray = $self->{source}->{excludes};
527+
return $exludearray;
528+
}
529+
530+
505531
# Procedure getAdditionalMountpoints
506532
# parameters: none
507533
# Return an array with combained list of additional mount point env,path,sharedPath

0 commit comments

Comments
 (0)