update s3backup adc to disable pushes first

(ref http://sitaramc.github.com/gitolite/doc/3-faq-tips-etc.html#_disabling_write_access_to_take_backups)

code from David Bremner via email
This commit is contained in:
Sitaram Chamarty 2011-04-24 15:14:37 +05:30
parent 78444c2e76
commit 6a51bae400

View file

@ -133,5 +133,18 @@ push(@args, $ENV{HOME}) unless ($subcommand eq 'prune');
push(@args, 's3+http://'.$S3_BUCKET);
system '/usr/bin/duplicity', @args;
my $semaphore=$ENV{HOME}."/.gitolite.down";
die "$semaphore already exists" if (-f $semaphore);
eval {
open (SEMFD,'>',$semaphore) or die ("failed to open $semaphore");
my $now = gmtime();
print SEMFD "Repo unavailable due to $subcommand backup started at $now GMT\n";
close SEMFD;
system '/usr/bin/duplicity', @args;
};
unlink $semaphore;