From 086ccfc2d34e8401486b97eb05ace116a14fe353 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 2 Apr 2007 13:36:40 +0000 Subject: * added support for removing an export (from disk and config-DB) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@855 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSExport/ExportType/NFS.pm | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'installer/OpenSLX/OSExport/ExportType/NFS.pm') diff --git a/installer/OpenSLX/OSExport/ExportType/NFS.pm b/installer/OpenSLX/OSExport/ExportType/NFS.pm index 8bb8ae48..b25736b8 100644 --- a/installer/OpenSLX/OSExport/ExportType/NFS.pm +++ b/installer/OpenSLX/OSExport/ExportType/NFS.pm @@ -46,9 +46,43 @@ sub exportVendorOS $self->addTargetToNfsExports($target); } +sub purgeExport +{ + my $self = shift; + my $target = shift; + + if (system("rm -r $target")) { + vlog 0, _tr("unable to remove export '%s'!", $target); + return 0; + } + 1; +} + ################################################################################ ### implementation methods ################################################################################ +sub copyViaRsync +{ + my $self = shift; + my $source = shift; + my $target = shift; + + if (system("mkdir -p $target")) { + die _tr("unable to create directory '%s', giving up! (%s)\n", + $target, $!); + } + my $includeExcludeList = $self->determineIncludeExcludeList(); + vlog 1, _tr("using include-exclude-filter:\n%s\n", $includeExcludeList); + open(RSYNC, "| rsync -av --delete --exclude-from=- $source/ $target") + or die _tr("unable to start rsync for source '%s', giving up! (%s)", + $source, $!); + print RSYNC $includeExcludeList; + if (!close(RSYNC)) { + die _tr("unable to export to target '%s', giving up! (%s)", + $target, $!); + } +} + sub addTargetToNfsExports { my $self = shift; -- cgit v1.2.3-55-g7522