From 0125615e9a648dbfd11f4ddfa6179f1ee98a25fe Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Wed, 22 Oct 2003 18:19:14 +0000 Subject: [PATCH] implemented findAndCopy git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@277 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/functions | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/util-vserver/scripts/functions b/util-vserver/scripts/functions index 556da5f..f9215f7 100644 --- a/util-vserver/scripts/functions +++ b/util-vserver/scripts/functions @@ -50,6 +50,19 @@ function findDir findObject -d "$@" } +function findAndCopy +{ + local dst=$1 + test ! -s "$dst" || return 0 + + local tmp + shift + findFile tmp "$@" + + test "$tmp" -a -s "$tmp" || return 0 + cp -af "$tmp" "$dst" +} + function getPhysicalDir { ( set -P && cd "$1" && pwd ) -- 1.8.1.5