Skip to content

Commit

Permalink
Merge branch 'release/0.7.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe committed Jan 15, 2016
2 parents 3bfd294 + a7a64ed commit 507fdd9
Show file tree
Hide file tree
Showing 34 changed files with 261 additions and 2,027 deletions.
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
Backup Manager 0.7.12
[ Philippe Villiers ]
* Fix for issue #35
Add make uninstall
* Fix for issue #60
Add -z to rsync parameters
* Override config's log level if specified by command line

[ psycho-nico ]
* use ssh port for rsync uploads

[ Dima Kogan ]
* Fix for issue #65
fix dead links
* Fix for issue #66
fix test suite
* Fix for debian bts #784446
fix purging of incremental archive while keeping the master

Backup Manager 0.7.11
[ Matthieu CERDA ]
* Add bandwidth limiting support in rsync uploads
Expand Down
16 changes: 8 additions & 8 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ How to install backup-manager

You can then edit /etc/backup-manager.conf to fit your needs.

Refere to the user guide for details:
http://www.backup-manager.org/documentation/user-guide/
Refere to the wiki for details:
https://github.com/sukria/Backup-Manager/wiki

For Apple OSX with Fink:
------------------------
Expand All @@ -23,20 +23,20 @@ For Apple OSX with Fink:

2) Download Backup-Manager:

Olga:~ user$ curl -L https://github.com/sukria/Backup-Manager/zipball/v0.7.10 > ~/Desktop/Backup-manager-0.7.10.zip
Olga:~ user$ curl -L https://github.com/sukria/Backup-Manager/zipball/v0.7.12 > ~/Desktop/Backup-manager-0.7.12.zip
Olga:~ user$ cd ~/Desktop
Olga:Desktop user$ unzip backup-manager-0.7.10.zip
Olga:Desktop user$ cd sukria-Backup-Manager-bc8f744
Olga:Desktop user$ unzip backup-manager-0.7.12.zip
Olga:Desktop user$ cd sukria-Backup-Manager-g3bfd294

3) Then "make install", and install the needed packages asked by Fink,
as all the needed packages are not installed with the basic Fink install.

Olga:sukria-Backup-Manager-bc8f744 user$ make install -e FINK=/sw
Olga:sukria-Backup-Manager-g3bfd294 user$ make install -e FINK=/sw

4) After complete install, copy, edit the "backup-manager.conf" file:

Olga:sukria-Backup-Manager-bc8f744 user$ cp /usr/share/backup-manager/backup-manager.conf.tpl /etc/backup-manager.conf
Olga:sukria-Backup-Manager-bc8f744 user$ vim /etc/backup-manager.conf
Olga:sukria-Backup-Manager-g3bfd294 user$ cp /usr/share/backup-manager/backup-manager.conf.tpl /etc/backup-manager.conf
Olga:sukria-Backup-Manager-g3bfd294 user$ vim /etc/backup-manager.conf

5) Then you can start Backup-Manager with:

Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2005-2010 The Backup Manager Authors
# Copyright © 2005-2016 The Backup Manager Authors
# See the AUTHORS file for details.
#
# This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -71,7 +71,7 @@ build: manpages

# The backup-manager package
install: build install_lib install_bin install_contrib install_man install_po
install_binary: build install_lib install_bin
install_binary: build install_lib install_bin

install_contrib:
@echo -e "*** Contrib files ***\n"
Expand Down Expand Up @@ -117,6 +117,20 @@ install_bin:
mkdir -p $(PERL5DIR)
mkdir -p $(PERL5DIR)/BackupManager
install -o root -g 0 -m 0644 BackupManager/*.pm $(PERL5DIR)/BackupManager

# Uninstall
uninstall:
@echo -e "\n*** Unsinstalling Backup-Manager ***\n"
@rm -fv $(DESTDIR)$(SBINDIR)/backup-manager
@rm -fv $(DESTDIR)$(BINDIR)/backup-manager-purge
@rm -fv $(DESTDIR)$(BINDIR)/backup-manager-upload
@rm -fv $(SHAREDIR)/backup-manager.conf.tpl
@rm -fv $(DESTDIR)$(PREFIX)/share/man/man8/backup-manager*.8
@rm -Rfv $(LIBDIR)
@rm -Rfv $(PERL5DIR)/BackupManager
@rm -Rfv $(SHAREDIR)
@rm -Rfv $(DESTDIR)$(PREFIX)/share/doc/backup-manager
@rm -fv $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/backup-manager.mo

# Building manpages
man/backup-manager-upload.8:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.11
0.7.12
31 changes: 17 additions & 14 deletions backup-manager
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env bash

# Copyright © 2005-2010 Alexis Sukrieh
# Copyright © 2005-2016 The Backup Manager Authors
# See the AUTHORS file for details.
#
# This program is free software; you can redistribute it and/or
Expand All @@ -26,8 +26,7 @@
set -e

RELEASE="true"
REVISION='$Revision$'
VERSION="0.7.11"
VERSION="0.7.12"

#Set prefix for paths
BIN_PREFIX=/usr/bin
Expand Down Expand Up @@ -91,20 +90,14 @@ nopurge="false"
noburn="false"
noupload="false"

# Init the version / revision flag
if [[ "$RELEASE" = "false" ]]; then
rev=$(echo "$REVISION" | sed -e 's/.Revision: \([0-9]*\).*/\1/g')
VERSION="${VERSION}r${rev}"
fi

debug "Version : $VERSION, release : $RELEASE"
debug "Version : $VERSION"

# Set useful global variables and initial
# checks
bm_init_today
bm_dbus_init

bm_dbus_send_event "startup" "Version : $VERSION, release : $RELEASE"
bm_dbus_send_event "startup" "Version : $VERSION"
bm_dbus_send_progress 0 "Initializing"

# Catch signals for a nice exit.
Expand Down Expand Up @@ -186,7 +179,7 @@ while [[ $# -ge 1 ]]; do
esac
shift
done
info "Backup Manager $VERSION - Copyright (c) 2004-2011 Alexis Sukrieh"
info "Backup Manager $VERSION - Copyright (c) 2004-2015 Alexis Sukrieh"

# Display some more info if we're doing an action
if [[ "$noupload" == "true" ]]\
Expand All @@ -199,14 +192,24 @@ fi
debug "Loading configuration file : \"$conffile\"."
source $conffile

# Override config's log level if specified by command line
if [[ "$verbose" == "true" ]]; then
if [[ "$verbosedebug" == "true" ]]; then
BM_LOGGER_LEVEL="debug"
else
BM_LOGGER_LEVEL="info"
fi
fi
if [[ "$warnings" == "false" ]]; then
BM_LOGGER_LEVEL="error"
fi

# Sanitize will try to find deprecated vartiables,
debug "Sanitizing the configuration file."
source $libdir/sanitize.sh

debug "Initializing environment"
bm_init_env
# Use a single md5 file to store all archives.
export MD5FILE="${BM_REPOSITORY_ROOT}/${BM_ARCHIVE_PREFIX}-hashes.md5"

debug "Checking if logger is available"
check_logger
Expand Down
109 changes: 65 additions & 44 deletions backup-manager-purge
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/perl
# Copyright © 2005-2010 Alexis Sukrieh
# Copyright © 2005-2016 The Backup Manager Authors
#
# See the AUTHORS file for details.
#
# This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -219,17 +220,6 @@ sub read_archives($$)
}
}


# Takes an archive and a meta-data hash ref
# and return 1 if the archive is outded according to $g_ttl,
# 0 else.
sub outdate_master_archive($$$$$)
{
my ($archive, $rh_meta, $purge_date,
$ra_archives, $ra_outdated) = @_;
}


# Takes two array refs. Reads from the first one the list of archives
# to process, and push in the second one the outdated archives.
sub outdate_archives($$)
Expand All @@ -243,43 +233,74 @@ sub outdate_archives($$)
my $purge_date = strftime ('%Y%m%d',
localtime(time() - $g_ttl * 24 * 3600));
print_info "Outdating archives made before $purge_date";


my %outdated = (); # set of outdated archives. Will be converted to a list
# at the end of this function
my %seen = ();
foreach my $archive (sort @{$ra_archives}) {
print_info "Checking archive $archive";

my $data = $g_rh_archives->{dataByPath}{$archive};
next unless defined $data;
next unless defined $data->{date};
next if $seen{$archive};
$seen{$archive} = 1;

# if the date of the archive is older than $purge_date, we may have to outdate it
# unless, nothing to do for that archive.
next if ($data->{date} > $purge_date);

# we can outdate a master only if a younger master exists
if ($data->{master}) {
foreach my $master_date (
keys %{$g_rh_archives->{$data->{name}}{pathByDateMasters}}) {
if ($master_date > $data->{date}) {
push @{$ra_outdated}, $archive;
last;
my $outdate_master_notmaster = sub
{
my $do_master = shift;


ARCHIVE_LOOP:
foreach my $archive (sort @{$ra_archives}) {
my $data = $g_rh_archives->{dataByPath}{$archive};
next unless defined $data;
next unless defined $data->{date};

# if the date of the archive is older than $purge_date, we may have to outdate it
# unless, nothing to do for that archive.
next if ($data->{date} > $purge_date);

# We can outdate a master only if a younger master exists
if ($data->{master} && $do_master) {
next if $seen{$archive};
$seen{$archive} = 1;

my $pathByDateMasters = $g_rh_archives->{$data->{name}}{pathByDateMasters};
foreach my $master_date ( keys %$pathByDateMasters) {
if ($master_date > $data->{date}) {
$outdated{$archive} = 1;
last;
}
}
}
}

# here the archive is deprecated, its date is < to $purge_date
else {
# if BM_ARCHIVE_STRICTPURGE is true, we can only purge
# an archive prefixed with BM_ARCHIVE_PREFIX
next if (($ENV{BM_ARCHIVE_STRICTPURGE} eq "true") and
($data->{prefix} ne $ENV{BM_ARCHIVE_PREFIX}));

# now, we're sure we can outdate the archive
push @{$ra_outdated}, $archive;
# here the archive is deprecated, its date is < to $purge_date
if (!$data->{master} && !$do_master) {

next if $seen{$archive};
$seen{$archive} = 1;

# An incremental archive should not be deleted if its master is
# still around. At this point I looked through all the masters
# and I know which ones I'm keeping. Any archive younger then
# the oldest master is kept
my $pathByDateMasters = $g_rh_archives->{$data->{name}}{pathByDateMasters};
foreach my $master_date ( keys %$pathByDateMasters) {
if ($master_date < $data->{date} && !$outdated{$pathByDateMasters->{$master_date}}) {
# I found an older master that I decided to keep. This
# archive should thus be kept as well
next ARCHIVE_LOOP;
}
}

# if BM_ARCHIVE_STRICTPURGE is true, we can only purge
# an archive prefixed with BM_ARCHIVE_PREFIX
next if (($ENV{BM_ARCHIVE_STRICTPURGE} eq "true") and
($data->{prefix} ne $ENV{BM_ARCHIVE_PREFIX}));

# now, we're sure we can outdate the archive
$outdated{$archive} = 1;
}
}
}
};


$outdate_master_notmaster->(1); # masters first
$outdate_master_notmaster->(0); # then the others

push @{$ra_outdated}, sort keys %outdated;
}

##############################################################
Expand Down
5 changes: 4 additions & 1 deletion backup-manager-upload
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/perl
# Backup Manager Upload - Multiprotocol uploader for backup-manager.
# Copyright © 2005-2016 The Backup Manager Authors
#
# See the AUTHORS file for details.

use strict;
use warnings;
Expand Down Expand Up @@ -629,7 +632,7 @@ sub ftptls_connect_to_host ($)
# How to upload files with ftp.
# We'll use the Net::FTP or the Net::Lite::FTP (for secured mode) module here.
# Net::Lite::FTP can be found here :
# http://search.cpan.org/~eyck/Net-Lite-FTP-0.45/lib/Net/Lite/FTP.pm
# http://search.cpan.org/~eyck/Net-Lite-FTP-0.61/lib/Net/Lite/FTP.pm
sub send_files_with_ftp($$$$$)
{
# getting args
Expand Down
11 changes: 3 additions & 8 deletions doc/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
The text version of the user guide is provided here:
user-guide.txt

If you want to use the HTML or PDF format, grab it from the Backup
Manager website:
http://www.backup-manager.org/documentation/

This has been written in SGML with the debiandoc tools.
The documentation is shipped as an SGML document. To build the PDF, TXT and HTML
versions of the documentation, run a "make" here. This uses tools debiandoc2xxx
from the "debiandoc-sgml" debian package
3 changes: 0 additions & 3 deletions doc/common.ent
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
<!-- Backup Manager related information -->
<!ENTITY bmngr "Backup Manager">
<!ENTITY bmngr-version "0.7.7">

<!-- Email addresses -->
<!ENTITY doc-email "<email>[email protected]</email>">
6 changes: 2 additions & 4 deletions doc/user-guide.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ has been reviewed by Sven Joachim.
<p>
While the author of this document has tried hard to avoid typos and other
errors, these do still occur. If you discover an error in this manual or if you
want to give any comments, suggestions, or criticisms please send an email to
the development list, [email protected], or submit a bug
report against the "Documentation" product, in the bug tracking
system<footnote>http://bugzilla.backup-manager.org/</footnote>.
want to give any comments, suggestions, or criticisms please create a new issue
at https://github.com/sukria/Backup-Manager/issues

<chapt id="configuration">Configuration files

Expand Down
Loading

0 comments on commit 507fdd9

Please sign in to comment.