From: Enrico Scholz Date: Wed, 22 Oct 2003 18:19:14 +0000 (+0000) Subject: implemented findAndCopy X-Git-Tag: VERSION_0_10~1139 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0125615e9a648dbfd11f4ddfa6179f1ee98a25fe;p=util-vserver.git implemented findAndCopy git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@277 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- 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 )