pax_global_header00006660000000000000000000000064126461432020014512gustar00rootroot0000000000000052 comment=a7a64ed7d2e06ac7039545cbf31882c7532b8eef Backup-Manager-0.7.12/000077500000000000000000000000001264614320200143565ustar00rootroot00000000000000Backup-Manager-0.7.12/.gitignore000066400000000000000000000000071264614320200163430ustar00rootroot00000000000000t/test Backup-Manager-0.7.12/AUTHORS000066400000000000000000000002411264614320200154230ustar00rootroot00000000000000 Backup Manager is currently maintained by Philippe Villiers. It was first written by Alexis Sukrieh. Check the ChangeLog file for details about contributors. Backup-Manager-0.7.12/BackupManager/000077500000000000000000000000001264614320200170565ustar00rootroot00000000000000Backup-Manager-0.7.12/BackupManager/Config.pm000066400000000000000000000014701264614320200206230ustar00rootroot00000000000000#!/usr/bin/perl package BackupManager::Config; =head1 NAME BackupManager::Config - BackupManager's configuration module =head1 DESCRIPTION Basically, it's a Getopt wrapper and a conffile reader. =cut use strict; use warnings; =head1 FUNCTIONS =head2 getopt() Comes from debconf, thanks joeyh ;) first arg : $usage (text to be written on STDERR if help is needed). @_ : GetOpt args. =cut our $usage; sub getopt ($@) { my ($_usage, @args) = (@_); $usage = $_usage; my $showusage=sub { # closure print STDERR $_usage."\n"; exit 1; }; # don't load big Getopt::Long unless really necessary. return unless grep { $_ =~ /^-/ } @ARGV; require Getopt::Long; Getopt::Long::GetOptions( 'help|h', $showusage, @args, ) || $showusage->(); } =head1 AUTHOR Alexis Sukrieh =cut 1; Backup-Manager-0.7.12/BackupManager/Dialog.pm000066400000000000000000000022331264614320200206130ustar00rootroot00000000000000package BackupManager::Dialog; use strict; use warnings; use vars qw(@ISA @EXPORT); @ISA = ('Exporter'); @EXPORT = qw(init_dialog print_info print_warning print_error); use BackupManager::Logger; my $dialog_verbose = 0; sub should_log($) { my ($level) = @_; my $level_score = { debug => 0, info => 1, warning => 2, error => 3, }; my $conf_level = $ENV{BM_LOGGER_LEVEL} || 'warning'; return $level_score->{$level} >= $level_score->{$conf_level}; } sub init_dialog($) { my ($verbose) = @_; $dialog_verbose = $verbose if defined $verbose; } sub print_info { my ($message) = @_; $message = "" unless defined $message; chomp $message; info ($message) if should_log 'info'; print STDOUT $message."\n" if $dialog_verbose; } sub print_warning { my ($message) = @_; $message = "" unless defined $message; chomp $message; warning ($message) if should_log 'warning'; print STDERR $message."\n" if $dialog_verbose; } sub print_error { my ($message) = @_; $message = "" unless defined $message; chomp $message; error ($message) if should_log 'error'; print STDERR $message."\n"; } 1; Backup-Manager-0.7.12/BackupManager/Logger.pm000066400000000000000000000062571264614320200206450ustar00rootroot00000000000000#!/usr/bin/perl package BackupManager::Logger; =head1 NAME BackupManager::Logger - BackupManager's Logger engine. =head1 DESCRIPTION It's a nice to use wrapper on the top of syslog. Will provide one function per syslog level. =head2 FUNCTIONS debug, info, notice, warning, error, critic and alert behave the same : take a string and log it with the appropriate level. =cut use Exporter ; @ISA = ( 'Exporter' ) ; @EXPORT = qw ( &debug &info ¬ice &warning &error &critic &alert ); use strict; use warnings; use Sys::Syslog qw(:DEFAULT setlogsock); sub basename($); use constant DEFAULT_FACILITY => 'cron'; our $LOG_IS_ENABLED; our $basename; my $LOG_FLAGS = { debug => 1, info => 1, notice => 1, warning => 1, err => 1, crit => 1, alert => 1 }; my $g_prefix = ""; my %g_rh_label = ( info => 'info ', notice => 'note ', err => 'error', warning => 'warn ', debug => 'debug', crit => 'crit ', alert => 'alert' ); my $facility; BEGIN { $basename = $0; $basename =~ s%^.*/%%; $facility=DEFAULT_FACILITY unless $facility=$ENV{BM_LOGGER_FACILITY}; setlogsock('unix'); openlog($basename, 'pid', $facility); } END { closelog(); } sub debug($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('debug', $message); } sub info($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('info', $message); } sub notice($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('notice', $message); } sub warning($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('warning', $message); } sub error ($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('err', $message); } sub critic ($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('crit', $message); } sub alert ($) { my ($message) = @_; return 0 unless defined $message and length $message; return log_with_syslog('alert', $message); } sub basename($) { my $full_path = shift; return undef unless defined $full_path; chomp($full_path); $full_path =~ s/\/*$//; my @words = split(/\//, $full_path); return $words[$#words]; } sub log_with_syslog ($$) { my ($level, $message) = @_; return 0 unless defined $level and defined $message; my $caller = 2; my ($package, $filename, $line, $fonction) = caller ($caller); $package = "" unless defined $package; $filename = "" unless defined $filename; $line = 0 unless defined $line; $fonction = $basename unless defined $fonction; $level = lc($level); $level = 'info' unless defined $level and length $level; return 0 unless $LOG_FLAGS->{$level}; unless (defined $message and length $message) { $message = "[void]"; } my $level_str = $g_rh_label{$level}; $message = $level_str . " * $message"; $message .= " - $fonction ($filename l. $line)" if $line; $message =~ s/%/%%/g; $message = $g_prefix . " > " . $message if (length $g_prefix); return syslog($level, $message); } =head1 AUTHOR Alexis Sukrieh =cut 1; Backup-Manager-0.7.12/COPYING000066400000000000000000000431311264614320200154130ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Backup-Manager-0.7.12/ChangeLog000066400000000000000000001110471264614320200161340ustar00rootroot00000000000000Backup 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 * Add file and directory exclusion support in rsync upload method * Enable SSH port definition support for rsync uploads [ Philippe Villiers ] * Backup should now stop and fail if the first piped command fails * Fixed .pgpass format error on creation. [ Nathaniel Clark ] * Upload: Add seperate TTL for S3 purge [ Guillaume Kulakowski ] * Fix RedHat bug #1208596 backup-manager package uses /share/locale/ while every other package use /usr/share/locale/ [ Ivan Borzenkov ] * backup all mysql databases one per file [ Christophe Labouisse ] * Fix for issue #29 tarball-incremental is not working with LZMA compression [ Ian Young ] * Fix POD syntax [ Larsen ] * Save MySQL DBs separately [ Max Tsepkov ] * Change the way to run BM_*_BACKUP_COMMAND * allow to add extra options to rsync upload * directly run BM_PRE_BACKUP and BM_POST_BACKUP_COMMAND [ Armel FORTUN ] * Add the OSX Fink make install support [ Toubib ] * Add vars for prefix use in Makefile [ George Zarkadas ] * Fixes for gettext make process and postgresql database backup method * Use a common naming scheme for archives created by one of the database backup methods. * Test for all database dumping programs that postgresql uses, to avoid breaking backup-manager on a broken postgresql installation. * Support empty hostname to allow connections to local postgresql database clusters using unix sockets. * Tighten the security of .pgpass (and its backup) file handling. * Make the build/clean process of gettext (po) files idempotent. * Fix for debian bts #608237 use absolute blacklist paths for / * Fix for debian bts #638803 use $TODAY to upload patch * Fix for debian bts #638919 Use a single md5 file to store all archives. * Fix for debian bts #638920 upload-database patch Backup Manager 0.7.10.1 [ Larsen ] * Fix for bug #237 Add nice level to commands used in lib/backup-methods.sh Backup Manager 0.7.10 [ Philippe Villiers ] * Typo fix in backup_method_pgsql(). * FIX bug #171 Bad file name for tarballs with "short" nameformat (Thanks to Laurent Léonard for the patch) * Fixed regression in fix for bug #179 (it breaks the 'monthly' BM_TARBALLINC_MASTERDATEVALUE). * FIX bug #101 Added support for PostgreSQL backup method (Thanks to Helios de Creisquer for the patch) * FIX bug #225 Added "--version" and "--debug" to --help output (Thanks to Larsen for the patch) * FIX bugs #237 and #244 - fixes incremental backups for tar.lz - fixes exclude patterns for tar.lz - nice level not set for tar.lz archives #237 (Thanks to Maciek Sitarz and Larsen for the patch) * FIX bug #240 Be sure to not treat BM_ARCHIVE_PREFIX as a deprecated boolean. * FIX bug #246 Archives created in "/" never obsoloted. (Thanks to Nicolas Baradakis for the patch) * FIX bug #240 will now create all needed dirs if $BM_REPOSITORY_ROOT or its parents do not exist [ Rached Ben Mustapha ] * Don't hardcode /usr when installing * The root group does not exist on FreeBSD, install using gid 0 * Don't hardcode the path to bash * Fix uploading very big archive files which don't fit in memory to Amazon S3. [ Sven Joachim ] * Search for genisoimage and wodim in addition to mkisofs and cdrecord * Change mode of $mysql_conffile to 600 before writing password to it * Fix long version of -c option in backup-manager.8 (closes Debian #225) [ Alexis Sukrieh ] * FIX bug #223 - New configuration variable `BM_LOGGER_LEVEL' to know which messages should be sent to syslog and which should not. - BackupManager Dialog now reads `BM_LOGGER_LEVEL' and behaves accordingly. - backup-manager-purge users BackupManager Dialog instead of the internal logger by hand. Backup Manager 0.7.8 [ Alexis Sukrieh ] * Tempfiles are correctly created/purged in backup-manager-upload (thanks to Josh Triplett and Thomas Parmelan; closes Debian #461512). * Added a --homedir flag to gnupg commands (thanks to Jochen Zimmermann; closes Debian #494833). * Removes MySQL configuration file when automatically created. (Thanks to Mihnea-Costin Grigore; closes Debian #496051) * Resets the error_code so a failure doesn't propagate. (Thanks to Filippo Giunchedi, closes Debian #482087) * Rewrite of check_error_code() so we can ignore some error codes depending on the program used. (Closes Debian #482089). * backup-manager-upload (closes bug #199) correctly report error when FTP uploads fail (thanks to Henning Bitsch for the report and Thomas Parmelan for the patch) * doc/user-guide.sgml (closes bug #200) Fixed the example for BM_ARCHIVE_NICELEVEL (thanks to Rafa G. for the report) * backup-manager-upload (closes bug #196) Fix in the get_ssh_opts function so we correctly retreive SSH/SCP switches. * backup-manager-upload (closes bug #195) Don't set a port switch to ssh/scp commands if BM_UPLOAD_SSH_PORT is not set. Thanks to Andy Shinn for the report and the diagnostic. * lib/backup-methods.sh (closes #194) Change permission whenever an archive is made, ether if it's correctly built or not. Thansk to Philippe Villiers for the report. * lib/backup-methods.sh (closes bug #178) Don't try to build empty archives for targets found in BM_TARBALL_BLACKLIST. Thanks to Henning Bitsch for the report. * lib/files.sh Process symlinks as well for building the purging list. * Makefile, doc/Makefile + Adding $(DESTDIR) where needed. + Better call to pod2man: --section 8 + Fixes in doc/Makefile * Fixed a typo in the user-guide (bug #167). * Makefile Adding the missing lib/dbus.sh line * Fixed all the tests scripts in t/ * Fixed the lzma commandline so the tar.lz archives are built. [ Rached Ben Mustapha ] * lib/dbus.sh + New module to signal state of backup-manager to listeners on D-BUS * lib/backup-methods.sh, lib/logger.sh, backup-manager + Use progress reporting and logging facilities from lib/dbus.sh * t/testlib.sh + Initialize dbus stuff so we know if it breaks things * doc/README.dbus + some dbus support docs 2007-04-24 Alexis Sukrieh * Release: 0.7.6 2007-03-13 Alexis Sukrieh * Support for a new variable that control whether BM should purge archives made by other instance of the one that is running (BM_ARCHIVE_STRICTPURGE) (closes: #153). 2007-02-20 Alexis Sukrieh * lib/backup-methods.sh + change every call to external command so that we can read their return code. + new function check_error_code() to handle BM's behaviour according to the external command's return codes. + If a return code equals 1 and the archive is created, consider it as a warning instead of an error (closes: #152). * Don't stop the main process if errors are triggered by external commands (closes: #141). 2007-01-02 Alexis Sukrieh * doc/user-guide.sgml, doc/user-guide.txt + More precise documentation about how to use a zero-TTL for local purging with a different one for remote ones. (closes: #144) 2007-01-02 Alexis Sukrieh * lib/backup-methods.sh + Fix the security vulnerability about passing MySQL client password through the commandline. Using ~/.my.cnf instead. (closes: #146) 2006-12-29 Alexis Sukrieh * doc/user-guide.sgml, doc/user-guide.txt + New section about the encryption using GPG. (closes: #132) 2006-12-29 Alexis Sukrieh * lib/sanitize.sh + Make sure BM_ENCRYPTION_RECIPIENT is defined when BM_ENCRYPTION_METHOD is set to gpg. * lib/backup-methods.sh + Handle gently encryption when building meta commands. (closes: #135) + The code of the gzip and the bzip2 compressors have been merged. Less code, less bugs Luke. 2006-12-11 Alexis Sukrieh * lib/files.sh + change a call to mktemp so it's compliant with old versions (mktemp ). 2006-10-23 Alexis Sukrieh * backup-manager: + Renamed the trap callback "stop_me()" to "clean_exit()"; more approriate name. * lib/dialog.sh: + Moved stop_me() to lib/backup-methods.sh - clean_exit() * lib/backup-methods.sh: + Handles smartly interrupted builds (remove any incomplete archive and friends if the build process has not been correctly finished). * Messages updates. 2006-10-20 Alexis Sukrieh * Makefile: + Don't build the docs by default anymore, the debiandoc tools may not be there. (close #134) 2006-10-20 Alexis Sukrieh * Copyright headers and debugging messages - lib/backup-methods.sh - lib/dialog.sh - lib/files.sh - lib/md5sum.sh - lib/sanitize.sh * If the GPG encryption feature is used, make sur we check if $archive.gpg exists instead of $archive when building archives. 2006-10-19 Alexis Sukrieh * doc/Makefile: + Don't build the doc files if they are up-to-date. * lib/actions.sh: + Copyright statement + more debug messages + tail -f logfiles * lib/burning-methods.sh: + Copyright statement + more debug messages + tail -f logfiles * po/backup-manager.pot, po/*.po: + Updates 2006-10-11 Alexis Sukrieh * doc/Makefile: + Don't build the doc files if they are up-to-date. * lib/backup-methods.sh: + lots of debug stuff, use tail_logfile() for outputing temp logfiles to stderr if the switch --debug is enabled. * lib/dialog.sh: + function tail_logfile(). 2006-10-11 Alexis Sukrieh * lib/logger.sh: + Exec the post-command when exiting. (closes: #118) 2006-10-11 Alexis Sukrieh * lib/sanitize.sh: + Make sure the $key we test is defined. (closes: #110) 2006-10-11 Alexis Sukrieh * lib/backup-methods.sh: + look for previous DAR archives in the last 30 ones possible. (closes: #127). 2006-10-06 Alexis Sukrieh * Makefile: + Added SVN properties to track some metadata. + Uses Perl to find out where to install the perl modules ($Config{sitelib}) thanks to Thomas Parmelan. + Build backup-manager-purge.8 manpage as well as backup-manager-upload.8. + New default target `build' so that everything that needs to be built is built when you issue `make'. * backup-manager: + Back to the unreleased mode, version is 0.7.5+REV 2006-09-16 Alexis Sukrieh * AUTHORS: + Bits updated in the AUTHORS file. * NEWS: + Release notes for 0.7.5 * backup-manager: + Release, version, and so on. 2006-09-16 Alexis Sukrieh * lib/backup-methods.sh: + Added `-p ${BM_UPLOAD_SSH_PORT}' when building tarball over SSH so the user can use a different port than 22 (thanks to Henning Bitsch). * lib/sanitize.sh: + Some sanitize statement to make sure BM_UPLOAD_SSH_PORT is defined. 2006-09-15 Alexis Sukrieh * Translation updates, all messages translated in all languages. 2006-09-13 Alexis Sukrieh * lib/backup-methods.sh: + Don't ignore BM_TARBALL_OVER_SSH, if it's set to true, actually do the remote stuff we are expected to (closes: #123). 2006-09-09 Alexis Sukrieh * lib/backup-methods.sh + Uses 'svnadmin -q' for disabling useless verbosity. 2006-09-08 Alexis Sukrieh * backup-manager-upload: + Fixed a bug with the FTP TLS code, use the correct API instead of the one of Net::FTP. 2006-09-08 Alexis Sukrieh [ Alexis Sukrieh & Michael Guerin ] * Support for FTP over TLS transfers. * New configuration key, `BM_UPLOAD_FTP_SECURE' in backup-manager.conf.tpl for enabling the FTP over TLS transfer. [ Alexis Sukrieh ] * Rewrite of the FTP part of the code in backup-manager-upload. * Documentation about BM_UPLOAD_FTP_SECURE configuration variable. 2006-09-06 Alexis Sukrieh [ Bjorn Wetzels ] * All messages translated in po/nl.po. 2006-09-06 Alexis Sukrieh [ Miroslav Kure ] * All messages transalted in po/cs.po. [ Matteo Frare Barutti ] * All messages translated in po/it.po. [ Alexis Sukrieh ] * Added nl in po/LINGUAS * Applied review from Stephane Blondon in po/fr.po. 2006-09-05 Alexis Sukrieh [ Sven Joachim ] * Fixes bad messages in + lib/burning-methods.sh + lib/dialog.sh: * All messages translated in de.po [ Alexis Sukrieh ] * Gettext files update + po/backup-manager.pot, po/cs.po, po/de.po, po/es.po, po/fr.po, po/it.po, po/vi.po. 2006-09-05 Alexis Sukrieh [ Clytie Sidall ] * All messages translated in po/vi.po. 2006-09-05 Alexis Sukrieh * po/LINGUAS + Added all supported languages in LINGUAS (thanks to Clytie Sidall). 2006-09-04 Alexis Sukrieh [ Matteo Frare Barutti ] * All messages translated in po/it.po. 2006-09-04 Alexis Sukrieh [ Carlos Galisteo ] * All messages translated in po/es.po. 2006-09-04 Alexis Sukrieh * lib/backup-methods.sh + Fixed an if-elif-else structure 2006-09-04 Alexis Sukrieh * All translations done in po/fr.po 2006-09-02 Alexis Sukrieh * Translations updates + All messages translated in po/cs.po + Updates in po/fr.po + All messages translated in po/vi.po 2006-09-02 Alexis Sukrieh * lib/upload-methods.sh: + Passes ssh options through the RSYNC_RSH environement variable instead of using the rsync -e switch in the command line. (closes: #122). 2006-09-01 Alexis Sukrieh [ Thomas Parmelan ] * Support for optional recursive purging (closes: #121) + Added BM_REPOSITORY_RECURSIVEPURGE in backup-manager.conf.tpl (plus examples). + Documentation about BM_REPOSITORY_RECURSIVEPURGE in the user guide (doc/user-guide.sgml and doc/user-guide.txt). + Change the depth passed to "find" according to BM_REPOSITORY_RECURSIVEPURGE in lib/files.sh. + Make sure BM_REPOSITORY_RECURSIVEPURGE is set in lib/sanitize.sh. [ Alexis Sukrieh ] * Make sure the new variable BM_REPOSITORY_RECURSIVEPURGE is set in base.conf so tests scripts don't produce warnings (t/confs/base.conf). * Test the purging system with/without recursion (t/t14-purging-system.sh). 2006-09-01 Alexis Sukrieh * lib/files.sh: + Applied patch from Thomas Parmelan for closing bug #120. The recursive purging phase now uses 'find' for building the archive list. (closes: #120) * t/t14-purging-system.sh: + Added some sub-directories in the test repository in order to reproduce bug #120. 2006-09-01 Alexis Sukrieh * t/testlib.sh: + That file was hit by bug#119 too, all the test scripts were broken. 2006-08-31 Alexis Sukrieh * lib/gettext.sh + Do not source /usr/share/backup-manager but $libdir instead (was breaking test scripts on boxes where BM isn't installed). * Replaced every #!/bin/sh by #!/bin/bash in test scripts. 2006-08-27 Alexis Sukrieh * lib/sanitize.sh: + BM_UPLOAD_SSH_HOSTS, BM_UPLOAD_SSH_USER and BM_UPLOAD_SSH_KEY are mandatory if BM_TARBALL_OVER_SSH is set to "true". (closes: #97). 2006-08-27 Alexis Sukrieh * backup-manager: + Replaced static paths to external programs by $(which statement). (closes: #114) * t/testlib.sh: + Applied the same changes to the teslib.sh library so the test scripts behave the same way. 2006-08-27 Alexis Sukrieh * BackupManager/Logger.pm: + Applied patch from ilya margolin for propagating BM_LOGGER_FACILITY (closes #115). * backup-manager: + Added a copyright header when BM is launched on verbose mode. 2006-08-07 Alexis Sukrieh * lib/backup-methods.sh: + the dar build commandline is now working. (closes: #109) 2006-08-05 Alexis Sukrieh * backup-manager: + Possible to use BM with an unprivileged user thanks to the new path used for the lockfile if run by a non-root user. 2006-08-05 Alexis Sukrieh * backup-manager-upload: * lib/upload-methods.sh: + No more su to $BM_UPLOAD_USER, it's useless. (closes: #105) 2006-07-05 Alexis Sukrieh [ Add support for local encryption with GPG - closes: #82 ] * backup-manager: + path to /usr/bin/gpg * backup-manager.conf.tpl: + New configuration variables - BM_ENCRYPTION_METHOD (gpg, none) - BM_ENCRYPTION_RECIPIENT (gpg ID) * lib/backup-methods.sh: + Support for encrypted archives, the build command is piped to gpg directly. * t/testlib.sh: + path to /usr/bin/gpg * t/t18-tarball-encryption.sh: + Test script for that new feature (builds a tar.gz.gpg archive). 2006-07-03 Alexis Sukrieh * lib/burning-methods.sh: + Fix the way md5 sums are checked (closes: #92) * lib/md5sum.sh: + safe_unmount() now works correctly and is able to unmount several times the media pointed by $BM_BURNING_DEVICE. * po/fr.po: + Fix about a bad translated message. 2006-07-03 Alexis Sukrieh * lib/backup-methods.sh: + Uses -eq instead of = when testing BM_TARBALLINC_MASTERDATEVALUE (closes: #104). 2006-06-30 Alexis Sukrieh [ Support for non-Joliet disc images (closes: #89) ] * backup-manager.conf.tpl: + New variable BM_BURNING_ISO_FLAGS for letting the suer choose which disc image to use (default "-R -J"). * doc/user-guide.sgml: + Bits about BM_BURNING_ISO_FLAGS * lib/burning-methods.sh: + Default BM_BURNING_ISO_FLAGS to "-R -J" if not defined for backward compatibility. + Uses $BM_BURNING_ISO_FLAGS instead of "-R -J" in mkisofs/growisofs commands. 2006-06-29 Alexis Sukrieh * lib/burning-methods.sh: + Correct syntax for the "-use-the-force-luke=tty" option in growisofs command lines (Thanks to Rached Ben Mustapha). 2006-06-29 Alexis Sukrieh * lib/burning-methods.sh: + Apply patch for adding the "-use-the-force-luke" switch in growisofs commands, possible to burn DVD+RW media within the CRON environement. (closes #102) 2006-06-27 Alexis Sukrieh [ support for tar.lz archives ] * backup-manager: + path to /usr/bin/lzma * backup-manager.conf.tpl: + adding support for BM_TARBALL_FILETYPE = tar.lz * doc/user-guide.sgml: * doc/user-guide.txt: + Bits in the documentation about tar.lz * lib/backup-methods.sh: + command line for building tar.lz archives 2006-06-21 Alexis Sukrieh * backup-manager: + VERSION = 0.7.4 * backup-manager.conf.tpl: + New variables, BM_UPLOAD_SSH_PURGE / BM_UPLOAD_SSH_PURGE + BM_TARBALL_OVER_SSH set to false by default. * doc/user-guide.sgml, doc/user-guide.txt: + Bits about SSH purging. * lib/backup-methods.sh: 2006-06-21 Alexis Sukrieh * NEWS: + Notes about last bug closed, #83). * backup-manager-upload: + Fixed the 'Net::Amazon::S3' error message (closes: #93). 2006-06-21 Alexis Sukrieh * VERSION: 0.7.4 * lib/backup-methods.sh: + (__exec_meta_command) Handle nicely errors with $? instead of counting words sent to stderr by the command (Closes: #83). + Same fix for the remote_command stuff. * t/t11-pipe-method.sh: + Template of a command that fails. 2006-06-20 Alexis Sukrieh * NEWS: + More details about bugs fixed in 0.7.4. * backup-manager-upload: + Support of SSH purging (in the same manner as for FTP and S3). * lib/upload-methods.sh: + Gently propagate the BM_UPLOAD_SSH_PURGE thing. 2006-06-20 Alexis Sukrieh * NEWS: + Bits from the devel corner. * lib/backup-methods.sh: + Support archive targets with spaces in their name and archive to expand as well. 2006-04-22 Alexis Sukrieh [ Based on the work done by Jan Metzger ] * Support of the new upload method "ssh-gpg". + backup-manager-upload - Supports a new value for --method (ssh-gpg). - New option --gpg-recipient - Uses explicit error codes when needed. - Stops using temp logfile, dump errors to stderr. - Updated the documentation (POD / man page). + backup-manager-conf.tpl - new upload method possible "ssh-gpg". - BM_UPLOAD_SSHGPG_RECIPENT added. + doc/user-guide.sgml / doc/user-guide.txt - Bits about the new upload method. + lib/actions.sh - new switch for calling the ssh-gpg upload if needed. + lib/upload-methods.sh - bm_upload_ssh_gpg() added, wrapper to backup-manager-upload. 2006-04-03 Alexis Sukrieh * lib/files.sh: + applied patch from Mario Domgörgen for fixing the get_date_from_archive() function. (closes: #68) * t/run-tests.sh: + Now redirect errors in /dev/null. * t/t14-purging-system.sh: + switch the verbosity off. 2006-04-02 Alexis Sukrieh,,, * AUTHORS: + added Brad Dixon about the S3 module. * VERSION: + 0.7.3 * Updated the user guide about the new purging system + minor changes. * lib/backup-methods.sh: + Some messages updated. * lib/burning-methods.sh: + Some messages updated. * lib/files.sh: + Rewrite of the purging system, better handling, support the new policy about master backups. * po/fr.po: + Translation updates. * t/run-tests.sh: + Better layout. 2006-03-29 Alexis Sukrieh * Closes bug #66 - Support of Amazon S3 uploads. + backup-manager-upload + backup-manager.conf.tpl + doc/user-guide.sgml + lib/actions.sh + lib/upload-methods.sh * lib/backup-methods.sh: + Support of the new variable BM_TARBALL_EXTRA_OPTIONS for appending extra options to the command line. 2006-03-28 Alexis Sukrieh * backup-manager.conf.tpl: + New configuration variable: BM_TARBALL_OVER_SSH * doc/user-guide.sgml: + Some bits about the new "tarball over ssh" thing. * doc/user-guide.txt: + Up to date version. * lib/backup-methods.sh: + It's now able to build archive locally (as before) or remotely (through SSH); closes: #58. * lib/files.sh: + Some TODO tags. 2006-03-24 Alexis Sukrieh * lib/actions.sh: + Some more errors when failing to chown/chmod. * lib/backup-methods.sh: + Some more errors when failing to chown/chmod. + Name differently master backups, using a ".master" suffix. * t/confs/base.conf: + added BM_REPOSITORY_USER and BM_REPOSITORY_GROUP * Changed all the tests to fit the new backup naming layout (.master): + t/t01-tarball.sh + t/t04-tarball-blacklist.sh + t/t06-bug14.sh + t/t07-dar.sh + t/t08-regexp.sh + t/t09-tarball-incremental.sh + t/t10-tarball-dar-blacklist.sh + t/t12-tarball-incremental-dar.sh 2006-03-16 Alexis Sukrieh * lib/upload-methods.sh: * t/t02-rsync.sh: 2006-03-15 Alexis Sukrieh * lib/upload-methods.sh: + applied patch from Nicolas Rennert for closing #49. + make sure we don't have a trailing / at the end of the RSYNC command. 2006-03-14 Alexis Sukrieh * backup-manager: + Added path for /usr/bin/7z * lib/backup-methods.sh: + Some of the basic stuff for the 7z support. + Warning, the blacklist stuff is not working! * lib/logger.sh: + umask redirected to /dev/null for getting rid of the crappy output. * t/t09-tarball-incremental.sh: + Never make master backups in that test. * t/testlib.sh: + Added path for /usr/bin/7z 2006-03-12 Alexis Sukrieh * lib/files.sh: + Applyied patch 21 for closing #50. (Stephen Kitt) 2006-03-12 Alexis Sukrieh * Makefile: + Stop rebuilding the backup-manager-upload.8 manpage ever and ever. If it exists, don't rebuild it. * VERSION: + Ready for the release 0.7.2 * backup-manager: + VERSION = 0.7.2 2006-03-11 Alexis Sukrieh * lib/actions.sh: + make_archives() now chown/chmod the md5 file to $BM_REPOSITORY_USER/$BM_REPOSITORY_USER. * lib/backup-methods.sh: + minor fixes/typo * lib/files.sh: + some formatting. 2006-03-10 Alexis Sukrieh * Setup an umask 0077 for creating files without world permissions. (closes: #47) * Restore the original umask when exiting. 2006-03-10 Alexis Sukrieh * backup-manager: + Disabled the -u flag, too much problems with the pipe method. * lib/backup-methods.sh: + Better layout of the __exec_meta_command. + Doesn't try to commit an archive if none. 2006-03-09 Alexis Sukrieh * backup-manager.conf.tpl: + speak about the DVD-RW burning method (with formating). + speak about the DVD method (without formating). * doc/common.ent: + New version of backup-manager: 0.7.2 * doc/user-guide.sgml: + Updates about the burning system. + Interactive mode + DVD / DVD-RW methods + --burn new option * doc/version.ent: + Revision 1.2 * lib/burning-methods.sh: + Split the burning method DVD into DVD and DVD-RW so we now have a burning method that doesn't blank the medium before writing data.. 2006-03-09 Rached Ben Mustapha * lib/upload-methods.sh: + Added support for the ServerAliveInterval ssh option. It is unconditional for now, but we should check if all supported version of ssh support it. This helps when the "building file list" step of rsync takes a loooong time (high I/O load for example), and the connection is closed because of non-activity. It is currently hardcoded to 60s, which seems like a good compromise. 2006-02-08 Alexis Sukrieh * NEWS: + Release notes for 0.7.1 * backup-manager.conf.tpl: + default blacklist items: /dev /proc /sys 2006-01-19 Alexis Sukrieh * lib/backup-methods.sh: + major rewrite of the code, much more clean and scalable. + dar support * t/testlib.sh: + added missing stuff here, for the tests. 2006-01-17 Alexis Sukrieh * backup-manager: + added the path to dvd+rw-format * lib/actions.sh: + now blank the DVD media explicitly before burning data. 2006-01-17 Alexis Sukrieh * lib/files.sh: + Applied patch from Michel Grentzinger for enhancing the way space occupation is computed (bug #22). 2006-01-17 Alexis Sukrieh * backup-manager: + added path to /usr/bin/dar * lib/backup-methods.sh: + major rewrite/clean of backup_method_tarball() + support for BM_ARCHIVE_FILETYPE "dar" * lib/dialog.sh: + check that dar is present. * backup-manager.conf.tpl + New configuration variable "BM_TARBALL_SLICESIZE". 2006-01-05 Alexis Sukrieh * backup-manager.conf.tpl: + added BM_MYSQL_SAFEDUMPS for providing a way to perform full clena backup with the "--opt" switch (closes bug #15) + Changed the behaviour of BM_MYSQL_DATABASES so we can put here a wildcard "__ALL__" that means backing up every databases at once. * lib/backup-methods.sh: + Changes in backup_mysql(). 2005-12-31 Alexis Sukrieh * Bug #14 closed. Backup methods are handled better so we can safely use several methods in the same configruation file. + lib/actions.sh: pass $method to each method. + lib/backup-methods.sh: handle $method rather than $BM_ARCHIVE_METHOD. + t/t06-bug14.sh: Regression-proof test for this bug. 2005-12-19 Alexis Sukrieh * INSTALL: + bits about dependencies * NEWS: + The 0.6 Changelog * doc/DISCLAIMER: + Removed, not needed anymore. * doc/README: + Bits about the available formats. * doc/user-guide.txt: + Added the text version in the repository, so users can have a light version of the guide with the release. * doc/version.ent: + Revision: 1.0 2005-12-19 Alexis Sukrieh * New configuration key BM_UPLOAD_SSH_PORT + backup-manager.conf.tpl + doc/user-guide.sgml * Added copyright headers + lib/backup-methods.sh + lib/dialog.sh + lib/logger.sh + lib/files.sh + lib/gettext-dummy.sh: + lib/gettext-real.sh: + lib/gettext.sh: + lib/md5sum.sh: * lib/sanitize.sh: + added copyright header + check for BM_BURNING * po/Makefile: + Minor changes * po/backup-manager.pot: + Added this pot file in the repository so people without xgettext can install BM. * po/es.po: + New version updated. 2005-12-16 Alexis Sukrieh * AUTHORS: + Better, less confusing. * doc/user-guide.sgml: + Sven Joachim fixes (typos...) 2005-12-16 Alexis Sukrieh * po/Makefile: + better clean target. * po/vi.po: + Final version of the Vietnamese translations. 2005-12-15 Alexis Sukrieh * AUTHORS: + Added Clytie Siddall in the translators list. * po/it.po: + Final version of the italian translation, thanks to Matteo Frarre Barutti. 2005-12-13 Alexis Sukrieh * po/Makefile: + use the .SUFFIXES method, better for handling correctly .mo files. * po/backup-manager.pot: + deleted, this file is generated on the fly. * po/es.po: + Minor correction, waiting for the reviewed version. 2005-12-13 Alexis Sukrieh * AUTHORS: + Cleaner + Added translators * THANKS: + Some typos, changes. * VERSION: + 0.6 !!! Yeah :) * backup-manager: + version= 0.6 (yeah) 2005-12-13 Alexis Sukrieh * Makefile: + add a target `docs' for building the userguide. * doc/Makefile: + install the user guide in /usr/share/backup-manager/doc * po/it.po: + First full version of the translated messages in Italian (Matteo Frare Barutti ). 2005-12-13 Alexis Sukrieh * po/es.po: + New translation from Niv Altivanik (not finished). * t/t05-hooks.sh: + clean a bit the test script, remove the verbose stuff. 2005-12-13 Alexis Sukrieh * No more yes/no -> true/false * French translatio ok. 2005-12-12 Alexis Sukrieh * Makefile: + install po files * backup-manager: + minor bug fix (call to bad function) * Removed most of "info -n" calls + lib/actions.sh: + lib/backup-methods.sh: + lib/files.sh: + lib/logger.sh: * po/Makefile: + Much cleaner * po/fr.po + New french version, complete. 2005-12-09 Alexis Sukrieh * backup-manager: + cleaned a bit the code. * backup-manager.conf.tpl: + removed useless BM_BURNING conf key (BM_BURNING_METHOD is enough). * Updated the tests, new test for the hooks. 2005-12-06 Alexis Sukrieh * backup-manager-upload: + chomp() the result of the shell command, better. * Renamed tests with understandable names. * t/t04-tarball-blacklist.sh: + New test for reproducing bug #4, cannot reproduce... * t/testlib.sh: + better paths for the lock and pid files. 2005-12-06 Alexis Sukrieh * doc/user-guide.sgml: + Chapter 3 is finished (well, remains a lot of typos but the main structure is there). 2005-12-06 Alexis Sukrieh * Minor changes to the tests. + t/confs/upload-rsync.conf + t/t01.sh 2005-12-05 Jimmy Gredler * t/confs/tarball-incremental.conf: + Changed the tarball directory to $PWD * t/confs/tarball.conf: + Changed the tarball directory to $PWD * t/confs/upload-global.conf: + Create an upload directory if it doesn't exist * t/confs/upload-rsync.conf: + Changed the rsync directory to $PWD + Use the current user as BM_UPLOAD_SSH_USER and the ssh identity bm-test 2005-12-05 Alexis Sukrieh * backup-manager.conf.tpl: + added the "none" methods in backup and upload sections. * lib/actions.sh: + it's possible to choose none of the backup methods. + it's possible to choose none of the upload methods. * t/t01.sh: + This test now uses the tarball method for building and archive of /etc, if it manages to build the archives, the test succeeds. * t/t02.sh: + Upload some stuff with rsync (to be updated)... * t/t03.sh: + Test that "none" is possible in the methods keys. 2005-12-05 Alexis Sukrieh * lib/upload-methods.sh: + rsync stuff works properly with root and with BM_UPLOAD_SSH_USER. 2005-12-05 Alexis Sukrieh * backup-manager.conf.tpl: + replaced BM_RSYNC by BM_UPLOAD_RSYNC * lib/actions.sh: + Renamed -snapshot by _snaphot * lib/files.sh: + Some more checks. * lib/sanitize.sh: + Better sanitizers for the RSYNC stuff. * lib/upload-methods.sh: + bm_upload_rsync_common() now managed rsync transfers with BM_UPLOAD_SSH_USER and call SSH in BatchMode. + Logs errors in a temp logfile. * t/t02.sh: + test script for RSYNC stuff. 2005-12-05 Alexis Sukrieh * added the t/ directory for handling tests. + t/confs/base.conf + t/confs/burning.conf + t/confs/mysql.conf + t/confs/pipe.conf + t/confs/svn.conf + t/confs/tarball-incremental.conf + t/confs/tarball.conf + t/confs/upload-ftp.conf + t/confs/upload-global.conf + t/confs/upload-rsync.conf + t/confs/upload-ssh.conf + t/run-tests.sh + t/t01.sh + t/testlib.sh 2005-12-05 Alexis Sukrieh * lib/sanitize.sh: + typo, hanlde -> handle. 2005-12-05 Alexis Sukrieh * BackupManager/Config.pm: + fixed some typos. * backup-manager: + removed some comments, cleaning. * backup-manager-upload: + deletes expired files on remote FTP hosts (closes: #1). + error when the repository is not readable (closes: #2). + using other ports than 22 is possible for SSH transfers, new configuration key "BM_UPLOAD_SSH_PORT" (closes: #5). * backup-manager.conf.tpl: + New confkeys for the upload methods, BM_UPLOAD_SSH_*, BM_UPLOAD_FTP_* * lib/actions.sh: + Code cleaning, upload_files() now uses the new stuff in lib/upload-methods.sh * lib/files.sh: + unmount_tmp_dir() now unmount $mount_point only if it's already mounted (closes: #6). * lib/sanitize.sh: + New sanitizers for the new configuration keys. * lib/upload-methods.sh: + New library for handling every upload methods, implemented here ssh and ftp methods. 2005-11-23 Alexis Sukrieh * backup-manager: + Added the copyright/licence notice. * doc/user-guide.sgml: + Better (really better) structure, that begins to be something... * Makefile + The clean target now cleans doc/ 2005-11-10 Alexis Sukrieh * backup-manager.conf.tpl: + details about the new configuration keys for the incremental backup method. 2005-11-10 Alexis Sukrieh * lib/backup-methods.sh: + bug fixed, always give the --listed-incremental flag when performing an incremental backup (even when doing a master tarball). 2005-11-10 Alexis Sukrieh * lib/actions.sh: + support the tarball-incremental method. * lib/backup-methods.sh: + patched the "tarball" method so it can handle incremental backups. * lib/sanitize.sh: + some sanitize checks for the new configuration keys related to incremental backups. Backup-Manager-0.7.12/INSTALL000066400000000000000000000030231264614320200154050ustar00rootroot00000000000000Dependencies: If you want to enable the localisation, you need gettext. Perl is needed for FTP and SSH uploads. Everything else is written in Bash. How to install backup-manager ~/backup-manager $ ~/backup-manager $ su ~/backup-manager # make install ~/backup-manager # cp /usr/share/backup-manager/backup-manager.conf.tpl /etc/backup-manager.conf ~/backup-manager # You can then edit /etc/backup-manager.conf to fit your needs. Refere to the wiki for details: https://github.com/sukria/Backup-Manager/wiki For Apple OSX with Fink: ------------------------ 1) Install Fink. 2) Download Backup-Manager: 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.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-g3bfd294 user$ make install -e FINK=/sw 4) After complete install, copy, edit the "backup-manager.conf" file: 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: Olga:~ user$ env PATH=/sw/lib/coreutils/bin:$PATH backup-manager -v 6) Backup-Manager is now installed in: /usr/share/backup-manager Backup-Manager-0.7.12/Makefile000066400000000000000000000125271264614320200160250ustar00rootroot00000000000000# Copyright © 2005-2016 The Backup Manager Authors # See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Makefile for Backup Manager written by Alexis Sukrieh, # smart ideas for finding out perl libraries' destination come # from Thomas Parmelan. # $Revision$ # $Date$ # $Author$ # Overwrite that variable if you need to prefix the destination # (needed for vendors). DESTDIR?= PREFIX?=/usr/local # Overwrite that variable with the Perl vendorlib Config value if # you package Backup Manager PERL5DIR?="$(DESTDIR)$(shell perl -MConfig -e 'print "$$Config{sitelib}"')" # Some static paths, specific to backup-manager BINDIR=$(PREFIX)/bin SBINDIR=$(PREFIX)/sbin VARDIR=$(PREFIX)/var LIBDIR=$(DESTDIR)/$(PREFIX)/lib/backup-manager CONTRIB=$(LIBDIR)/contrib SHAREDIR=$(DESTDIR)/$(PREFIX)/share/backup-manager SHFILES=\ lib/externals.sh \ lib/dialog.sh \ lib/files.sh \ lib/actions.sh \ lib/dbus.sh \ lib/backup-methods.sh\ lib/upload-methods.sh\ lib/burning-methods.sh\ lib/logger.sh \ lib/gettext.sh \ lib/gettext-real.sh \ lib/gettext-dummy.sh \ lib/sanitize.sh \ lib/md5sum.sh # For the backup-manager-doc package DOCDIR = $(DESTDIR)/$(PREFIX)/share/doc/backup-manager DOCHTMLDIR = $(DOCDIR)/user-guide.html DOCPDF = doc/user-guide.pdf DOCHTMLFILES = doc/user-guide.html/*.html DOCPDF = doc/user-guide.pdf DOCTXT = doc/user-guide.txt # Main build rule (we don't buid the docs as we don't know if debiandocs can be # there) so the docs target has to be called manually by vendors. 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_contrib: @echo -e "*** Contrib files ***\n" install -d $(CONTRIB) install -m0755 contrib/*.sh $(CONTRIB) # The backup-manager-doc package install_doc: @echo -e "\n*** Building the User Guide ***\n" $(MAKE) -C doc DESTDIR=$(DESTDIR) install -d $(DOCDIR) install -o root -g 0 -m 0644 $(DOCPDF) $(DOCDIR) install -o root -g 0 -m 0644 $(DOCTXT) $(DOCDIR) install -d $(DOCHTMLDIR) install -o root -g 0 -m 0644 $(DOCHTMLFILES) $(DOCHTMLDIR) # The translation stuff install_po: $(MAKE) -C po install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) # The backup-manager libraries install_lib: @echo -e "\n*** Installing libraries ***\n" install -d $(LIBDIR) install -o root -g 0 -m 0644 $(SHFILES) $(LIBDIR) # The main stuff to build the backup-manager package install_bin: @echo -e "\n*** Installing scripts ***\n" mkdir -p $(DESTDIR)/$(SBINDIR) mkdir -p $(DESTDIR)/$(BINDIR) mkdir -p $(SHAREDIR) install -o root -g 0 -m 0755 backup-manager $(DESTDIR)/$(SBINDIR) install -o root -g 0 -m 0755 backup-manager-purge $(DESTDIR)/$(BINDIR) install -o root -g 0 -m 0755 backup-manager-upload $(DESTDIR)/$(BINDIR) install -o root -g 0 -m 0644 backup-manager.conf.tpl $(SHAREDIR) # Set PREFIX to backup-manager binary sed "s#^BIN_PREFIX=.*#BIN_PREFIX=$(DESTDIR)/$(BINDIR)#" -i $(DESTDIR)/$(SBINDIR)/backup-manager sed "s#^LIB_PREFIX=.*#LIB_PREFIX=$(DESTDIR)/$(PREFIX)/lib#" -i $(DESTDIR)/$(SBINDIR)/backup-manager sed "s#^VAR_PREFIX=.*#VAR_PREFIX=$(VARDIR)#" -i $(DESTDIR)/$(SBINDIR)/backup-manager 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: PERL5LIB=. pod2man --section 8 --center="backup-manager-upload" backup-manager-upload > man/backup-manager-upload.8 man/backup-manager-purge.8: PERL5LIB=. pod2man --section 8 --center="backup-manager-purge" backup-manager-purge > man/backup-manager-purge.8 # build the manpages manpages: manpages-stamp manpages-stamp: man/backup-manager-upload.8 man/backup-manager-purge.8 touch manpages-stamp # Installing the man pages. install_man: manpages-stamp @echo -e "\n*** Installing man pages ***\n" install -d $(DESTDIR)/$(PREFIX)/share/man/man8/ install -o root -g 0 -m 0644 man/*.8 $(DESTDIR)/$(PREFIX)/share/man/man8/ testperldir: @echo "PERL5DIR: $(PERL5DIR)" docs: make -C doc all clean: rm -f build-stamp rm -rf debian/backup-manager rm -f man/backup-manager-upload.8 #rm -f man/*.8 $(MAKE) -C po clean $(MAKE) -C doc clean Backup-Manager-0.7.12/NEWS000066400000000000000000000300371264614320200150600ustar00rootroot000000000000000.7.6 - Security Fix - Don't pass MySQL password in the commandline, use ~/.my.cnf instead (bug #146). - New features - Support for the --debug flag for outputting lots of information (bug #124). - Documentation of the local GPG encryption feature (bug #132). - Bug Fixes - No limitation to the number of files located in $BM_REPOSITORY_ROOT (bug #110). - better handling of dar masters, don't fail if an archive is missing (bug #127). - Fixed a typo in the default configuration file (bug #133). - SQL dumps are encrypted as well if BM_ENCRYPTION_METHOD is set to gpg (bug #135). - Don't fail if a file changed during the archive generation (bug #152). - The purging phase handle only archives that are prefixed with $BM_ARCHIVE_PREFIX (bug #153) - Changes - The post-command is now always exectued, event if an error occured before (bug #118). - Don't stop the pipe commands if one of them fails (bug #141). 0.7.5 - New features - Support for lzma archives. - Support for encryption of local archives with GPG. - Support for FTP over SSL transfers (FTP upload method). - Possible to burn non-Joliet disc image. - Possible to choose if the purging should be recursive or not. - Bug Fixes - Fix for the md5 checking phase (was broken). - Possible to burn DVD+R(W) within CRON environment. - $BM_LOGGER_FACILITY is not ignored anymore. - RSYNC uploads work smoothly again. - Fix for the purging phase, no more annoying error messages. - Changes - SCP uploads are not performed with the $BM_UPLOAD_SSH_USER identity. - backup-manager can be run by an unprivileged user. - Paths of external programs are autodetected (no more static paths). - The purging phase is not recursive by default. 0.7.4 - New feature(s) - Possible to purge remote archives through SSH (new configuration variables: BM_UPLOAD_SSH_PURGE, BM_UPLOAD_SSH_TTL). - Bug fixes - Handle smartly pipe commands, don't think a command failed if not (closes: #83). - Can handle several targets in BM_TARBALL_TARGETS[] even if one the targets contains a space. - Support for expandable targets in BM_TARBALL_TARGETS[] (eg: you can put /home/* and you'll get what you expect to). - Default configuation file set BM_TARBALL_OVER_SSH to "false" instead of "true". - Doesn't trigger an error when BM_TARBALL_DIRECTORIES is not set anymore. - BM_TARBALL_DIRECTORIES is not deprecated anymore, possible to use it as well as BM_TARBALL_TARGETS[] the user can choose what he wants. 0.7.3 - New Features: - New upload method: ssh-gpg (upload backups encrypted on-the-fly with GPG). Thanks to Jan Metzger for his work. - New upload method: Support for the Amazon S3 Web Service. Thanks to Brad Dixon for his work. - New option for the tarball generation: possible to build archives over SSH (thanks to the new variable BM_TARBALL_OVER_SSH). - Possible to choose which permissions to set on the repository/archives when using the secure mode. - New configuration variable "BM_UPLOAD_TTL" so remote archives can live longer than local ones. - Bug Fixes: - Possible to enable FTP passive uploads for boxes behind a firewall. - The .md5 files are not left on remote servers anymore during the FTP purging phase. - Bugfix in the duplicates purging system. - The burning system can now safely burn archives in non-interactive mode. - Support for targets to backup with spaces in their names. - Changes: - The variable BM_TARBALL_DIRECTORIES is deprecated, it's replaced by the array BM_TARBALL_TARGETS[]; so paths with spaces can be safely handled. - Full backups are now named differently than incremental ones: the suffix "master" is appended to them. - During the purging phase, masters aren't purged unless a newer master is present. 0.7.2 * New Features: + It's now possible to use the burning system interactively in order to burn the whole repository into several media. [Michel Grentzinger, Alexis Sukrieh] + New option for the "--burn" switch, possible to give a specific date for burning only data of that day (eg: `--burn 20060310'). [Michel Grentzinger, Alexis Sukrieh] + New kind of DVD media: "DVD-RW". This kind of medium implies blanking the medium before burning data whereas the "DVD" kind doesn't. [Alexis Sukrieh] * Bug Fixes: + Incremental backup with dar now works correctly. + MD5 hashes are updated in the .md5 file when rebuilding an existing archive. + Stop removing files located in $BM_REPOSITORY_ROOT that aren't archives. + This release closes a total of 16 known bugs since the last release. [The Devel Team] * Changes: + Added support for the ServerAliveInterval ssh option. This helps when the "building file list" step of rsync takes a long time (high I/O load for example), and the connection is closed because of non-activity. [ Reched Ben Mustapha ] 0.7.1 * New Features: + Full "dar" archives support. + New variable `BM_MYSQL_SAFEDUMPS' for making safe MySQL dumps (locking tables). * Changes: + Better support of DVD-RW media, bugfix of the DVD burning method. 2005-12-31 (0.6.1) Alexis Sukrieh * Bug fix Several backup methods can be used safely in the same configuration file, the incremental method will then work as expected (Bug #14 closed). 2005-12-19 (0.6) Alexis Sukrieh * New Features: + New backup method "tarball-incremental" for building incremental backups. + New upload metyhod "rsync". + Support for multiple backup methods in BM_ARCHIVE_METHOD + Support for multiple upload methods in BM_UPLOAD_METHOD + User Guide available in different formats (HTML, PDF) * Changes: + Booleans must be true/false values, yes/no are deprecated (triggers warnings but backward compatible though). + Configuration key "BM_BURNING" is deprecated, use "BM_BURNING_METHOD" instead. * Bugs closed by this release: + No error when the repository is not accessible by BM_UPLOAD_USER (bug #2) + [BM_TARBALL_BLACKLIST] error handling multiple directories (bug #4) + feature request: use of ports other than 22 for scp upload (bug #5) + Backup-Manager can't umount an unmounted CD (bug #6) + Write the user guide (bug #8) + Support for multiple methods in BM_ARCHIVE_METHOD (bug #9) + Function backup_method_rsync() uses BM_TARBALL confkeys (bug #10) + Configuration keys BM_UPLOAD_USER/KEY/PASSWORD should be renamed (bug #11) * Translations: + Full translation in French. + Full translation in German. + Full translation in Spanish. + Full translation in Vietnamese. 2005-11-07 (0.5.9b) Alexis Sukrieh * New Features: + New method "svn", SubVersioNs repositories can be archived safely with svnadmin. + New method "pipe", Generic method for making archive with an external command, athe content sent to stdout will be used. + DVD burning support is available. You can choose to burn your archive repository on a DVD media, growisofs is used for this purpose. * Changes: + Added a switch in the command line for the version number "--version". + Some more comments in the configuration file. + No default backup method anymore, trigger an error if unknown method given. + AUTHORS: fixed the name of "jimmy". + Makefile: man pages are generated and isntalled in the good section. + backup-manager.conf.tpl: Several typos. * Bugs closed: + md5 files now have two spaces between the hash and the file name so the file is now usable with md5sum --check. (closes: #3) + The backup switch now call backup_method_pipe() if needed. + "tarball" method is not the default one anymore, must be called explicitly. * Translations: + po/fr.po: New version of the French translations. 0.5.9 Alexis Sukrieh * Configuration keys have been drastically renamed. * Added a contrib script for upgrading the configuration files to the new format: upgrade-conffile.sh * Upgraded the validation process, so deprecated variables trigger warnings and are used as default values for the right name. * Better control of the tar commands, when an error occured, user is warned, and a temp logfile is given. * Huge code cleanup for providing a modular implementation for several archive methods. * New archive method : mysql + uses mysqldump on a list of given databases. + facility to choose a compression format for the resulting SQL file. * TODO backup method rsync * TODO backup method pipe 0.5.8b Alexis Sukrieh * Configuration keys have been drastically renamed. * Security fixes + When burning a CDR, mktemp is used to prevent attacks on the file system. + It is possible to make the archive repository readable/writable by a given user/group pair. * Features + The configuration file is now validated before running. Warnings are triggered if configuration keys are not set. * Bug fixes + If the filetype "tar.bz2" is chosen, /usr/bin/bzip2 is mandatory. + The pre-command is run before the creation of the archive repository. + No trailing spaces are lost anymore when printing messages. * New configuration keys: + BM_PURGE_DUPLICATES tells if duplicates should be replaced by symlinks (default is yes). + BM_REPOSITORY_SECURE tells if the archive repository and the archive should be readable/writable by a given user:group (default is yes). + If BM_REPOSITORY_SECURE is activated, BM_USER and BM_GROUP should be filled (default is root:root). + BM_BURNING_CHKMD5 tells if the MD5 checksums should be checked when a CDR is burnt (default is yes). + BM_BURNING_DEVFORCED tells backup manager to force a device whenever a cdrecord command is performed, and then bypass the default cdrecord device (default is disabled). 0.5.8a Alexis Sukrieh * bug fix in the logger, the output is now clean. * bug fix when making tarballs: we don't warn about an already existing file if not true. * New library for holding backup methods. * first implementation of the rsync backup method (experiemntal). 0.5.8 Alexis Sukrieh * Fixed a bug when calculating total disk usage of a specified path when the locale is not en_EN or fr_FR. * Added the possibility to log everything to syslog. A new configuration key is provided : BM_LOGGER for setting this new feature on or off (default is on). Note that the user can choose which syslog facility he wants (default is user). * Added the facility to set BM_USER and BM_GROUP for providing a way to chmod and chown the repository and the archives. (closes a security issue) * When creating archives, backup-manager now replaces any duplicate it founds with symlink to the most recent archive for saving disk space. * Added BM_FTP_PURGE configuration key for removing files on ftp transfer before uploading files. 0.5.7 Alexis Sukrieh * Removed the file TODO * Added a COPYING file with the content of the GPL V2. * Renamed backup-manager.conf.tpl backup-manager.conf. * Better handling of pre and post commands. * Added a file CHANGELOG. Backup-Manager-0.7.12/README000066400000000000000000000017671264614320200152510ustar00rootroot00000000000000 Backup Manager * A really simple to use backup tool * https://github.com/sukria/Backup-Manager/ Description --------------------------------------------------------------------- Backup Manager is a command line backup tool for GNU/Linux, designed to help you make daily archives of your file system. Written in bash and perl, it can make archives in many formats and can be run in a parallel mode with different configuration files. Archives are kept for a given number of days and the upload system can use ftp or scp to transfer the generated archives to a list of remote hosts. The configuration file is very simple and basic and gettext is used for internationalization. Installation --------------------------------------------------------------------- See the file INSTALL Rporting Bugs --------------------------------------------------------------------- Use the GitHub bug tracking system: https://github.com/sukria/Backup-Manager/issues Backup-Manager-0.7.12/THANKS000066400000000000000000000005561264614320200152770ustar00rootroot00000000000000I would like to thank Esteban Manchado Velázquez who has helped me a lot in the debianization of backup-manager. All his advices and comments made me aware of some interesting issues and gave backup-manager a better shape. Also a big thank to everyone who helped the backup-manager project, translators, contributors and of course, users. - Alexis Sukrieh. Backup-Manager-0.7.12/VERSION000066400000000000000000000000071264614320200154230ustar00rootroot000000000000000.7.12 Backup-Manager-0.7.12/backup-manager000077500000000000000000000160151264614320200171640ustar00rootroot00000000000000#! /usr/bin/env bash # Copyright 2005-2016 The Backup Manager Authors # See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # This is the main backup-manager script. # # $Revision$ # $Date$ # $Author$ set -e RELEASE="true" VERSION="0.7.12" #Set prefix for paths BIN_PREFIX=/usr/bin LIB_PREFIX=/usr/lib VAR_PREFIX=/var/lib #Set prefix for paths BIN_PREFIX=/usr/bin LIB_PREFIX=/usr/lib VAR_PREFIX=/var/lib # All the paths we provide libdir="$LIB_PREFIX/backup-manager" vardir="$VAR_PREFIX/backup-manager" bmu="$BIN_PREFIX/backup-manager-upload" bmp="$BIN_PREFIX/backup-manager-purge" # Find which lockfile to use # If we are called by an unprivileged user, use a lockfile inside the user's home; # else, use /var/run/backup-manager.lock systemlockfile="/var/run/backup-manager.lock" userlockfile="$HOME/.backup-manager.lock" if [[ "$UID" != 0 ]]; then lockfile="$userlockfile" else lockfile="$systemlockfile" fi # Default value for logger, as we didn't read the config file yet BM_LOGGER_LEVEL="info" # Load the backup-manager's library source $libdir/externals.sh source $libdir/gettext.sh source $libdir/logger.sh source $libdir/dialog.sh source $libdir/files.sh source $libdir/md5sum.sh source $libdir/backup-methods.sh source $libdir/upload-methods.sh source $libdir/burning-methods.sh source $libdir/actions.sh source $libdir/dbus.sh debug "Libraries loaded successfuly from \"$libdir\"." # Initialize defautls values of arguments verbosedebug="false" verbose="false" version="false" warnings="true" force="false" upload="false" burn="false" help="false" md5check="false" purge="false" conffile="/etc/backup-manager.conf" # The "no" flags nopurge="false" noburn="false" noupload="false" debug "Version : $VERSION" # Set useful global variables and initial # checks bm_init_today bm_dbus_init bm_dbus_send_event "startup" "Version : $VERSION" bm_dbus_send_progress 0 "Initializing" # Catch signals for a nice exit. trap clean_exit SIGINT SIGTERM SIGKILL # Parse the command line debug "Processing the command line" while [[ $# -ge 1 ]]; do case $1 in -h|--help) usage ;; -m|--md5check) md5check="true" ;; -p|--purge) purge="true" ;; --no-purge) nopurge="true" ;; -b|--burn) burn="true" # parse the second argument as a date if # it does not begin with a dash (-). if [[ -n "$2" ]] && [[ "${2}" == "${2#-}" ]]; then # test if the date is a valid date if [[ $(echo "$2" | grep "^[[:digit:]]\{8\}$") ]] ; then export BM__BURNING_DATE="$2" shift else error "The -b option must be followed by a valid date (YYYYMMDD)." fi fi ;; --no-burn) noburn="true" ;; -u|--upload) upload="true" ;; --no-upload) noupload="true" ;; -d|--debug) verbosedebug="true" verbose="true" ;; -v|--verbose) verbose="true" ;; --version) echo "Backup Manager $VERSION" _exit 0 ;; --no-warnings) warnings="false" ;; -f|--force) force="true" ;; -c|--conffile) # in this case, $2 should be the conffile ! if [[ -f $2 ]]; then conffile=$2 else error "The -c option must be followed by an existing filename." usage fi # we shift here to avoid processing the file path shift ;; *) echo "Unknown option $1" usage break ;; esac shift done info "Backup Manager $VERSION - Copyright (c) 2004-2015 Alexis Sukrieh" # Display some more info if we're doing an action if [[ "$noupload" == "true" ]]\ || [[ "$noburn" == "true" ]]\ || [[ "$nopurge" == "false" ]]; then curr_time=`date +%Y-%m-%d%t%T` info "Process started at $curr_time" 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 debug "Checking if logger is available" check_logger debug "Getting lock" get_lock check_filetypes # For security reasons, change the umask # for the backup-manager session. # Every file created by the process will be -rw------ BM_UMASK=$(umask) umask 0077 debug "Running pre-command" exec_pre_command || error "Unable to exec the pre-command" create_directories if [[ "$upload" == "true" ]]; then debug "Running the upload methods" upload_files _exit 0 fi if [[ "$burn" == "true" ]]; then debug "Running the burning methods" burn_files _exit 0 fi if [[ "$md5check" == "true" ]]; then debug "Runing the MD5 checks" check_cdrom_md5_sums _exit 0 fi if [[ "$purge" == "true" ]]; then debug "Purging the repository" clean_repositories _exit 0 fi # Default process : doing everything unless --no-flags # are given. if [[ "$nopurge" != "true" ]]; then debug "Purging the repository" bm_dbus_send_progress 10 "Cleaning repositories" clean_repositories fi debug "Building archives" bm_dbus_send_progress 20 "Building archives" make_archives if [[ "$noupload" != "true" ]]; then debug "Running the upload methods" bm_dbus_send_progress 60 "Uploading backups" upload_files fi if [[ "$noburn" != "true" ]]; then debug "Running the burning methods" bm_dbus_send_progress 80 "Burning backups" burn_files fi debug "Running post-command" bm_dbus_send_progress 90 "Cleaning up" exec_post_command || error "Unable to exec post-command." debug "Releasing lock" release_lock debug "Exiting" umask $BM_UMASK >/dev/null curr_time=`date +%Y-%m-%d%t%T` info "Process finished at $curr_time" bm_dbus_send_progress 100 "Finished" bm_dbus_send_event "shutdown" "0" exit 0 Backup-Manager-0.7.12/backup-manager-purge000077500000000000000000000233621264614320200203070ustar00rootroot00000000000000#!/usr/bin/perl # Copyright © 2005-2016 The Backup Manager Authors # # See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. use strict; use warnings; =pod =head1 NAME backup-manager-purge - backup-manager's wrapper for outdating files =head1 SYNOPSIS backup-manager-purge [TTL] =head1 DESCRIPTION B is the only authorized entity that can say if an archive should be purged or not. Any tasks used by backup-manager may have to know if an archive is deprecated (eg: the purging phase of an upload method). This tool is here to fulfill that need. Given a I