From 0125c89a9b9ee4604d6e654c214bfaf6e246af02 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 26 Oct 2010 14:36:56 +0200 Subject: [PATCH] make destination directory if needed this allows you to diff files between two machines without adding them to bak first (which also worked before, but all required directories needed to be present in bak allready) --- bak-git-server.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/bak-git-server.pl b/bak-git-server.pl index 67262c9..c979f6e 100755 --- a/bak-git-server.pl +++ b/bak-git-server.pl @@ -167,6 +167,7 @@ while (my $client = $server->accept()) { $command = 'log --patch-with-stat' if $command =~ m/^ch/; pull_changes( $hostname ) if $command eq 'diff'; if ( $on_host ) { + mkpath "$hostname/$dir" unless -e "$hostname/$dir"; rsync( '-avv', "root\@$hostname:$path", "$hostname/$path" ); rsync( '-avv', "root\@$on_host:$path", "$on_host/$path" ); open(my $diff, '-|', "diff -Nuw $hostname$path $on_host$path"); -- 2.20.1