From ccefcb26ba4447a31bd4370eb26bd038d6ceaa3f Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 12 May 2011 19:17:00 -0500 Subject: Exclude white-out files from copy. Backup current config dir before clone --- scripts/vyatta-image-tools.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/vyatta-image-tools.pl') diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl index e2dbba6..034a676 100755 --- a/scripts/vyatta-image-tools.pl +++ b/scripts/vyatta-image-tools.pl @@ -180,16 +180,18 @@ sub update { my $msg = "WARNING: This is a destructive copy of the /config directories\n" . "This will erase all data in the ".$print_to."config directory\n" . "This data will be replaced with the data from $print_from\n" + . "The current config data will be backed up in $print_to/config.preclone\n" . "Do you wish to continue?"; if (y_or_n("$msg")){ - system("rm -rf $to/config"); + system("rm -rf $to/config.preclone"); + system("mv $to/config $to/config.preclone"); rsync("$from/config", $to); } } sub rsync { my ($from,$to) = @_; - system("rsync -a --progress $from $to"); + system("rsync -a --progress --exclude '.wh.*' $from $to"); } sub curl_to { -- cgit v1.2.3