Summary: Makes the SME server a dedicated rsync based backup server %define name smeserver-affa Name: %{name} %define version 0.9.0 %define release 1 Version: %{version} Release: %{release}%{?dist} License: GNU GPL (GNU General Public License) Group: Applications/Archiving Source: %{name}-%{version}.tar.gz BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArch: noarch AutoReq: no Requires: smeserver-release >= 7 Requires: perl-Filesys-DiskFree BuildRequires: e-smith-devtools %description Main purpose ist to make the SME server a dedicated rsync based backup server. Also providing functions to backup to USB disks or SMB shares in SOHO environments. %changelog * Fri Feb 1 2008 Shad L. Lords 0.9.0-1 - Fix specfile for building in new buildsystem * Fri Jan 18 2008 Michael Weinberger Version 0.9.0 Bugfix: run cronSetup() after job delete Throw error if nothing was backed up (empty archive) Added rsyncd support for backing up Windows/Cygwin Added option and property remoteOS. Which remoteOS=cgywin the send key and revoke key functions use the right path to the authorized_keys2 file and login as user Administrator * Sat Dec 29 2007 Michael Weinberger Version 0.8.1 Automount Bugfix [Bug 3165]: Only exit with error on mount failure when in backup run. Otherwise log the error and continue. * Thu Dec 20 2007 Michael Weinberger Version 0.8.0 added bash completion script added option --kill JOB improved INT and TERM signal handling replaced all scp commands by rsync added poperty BandwidthLimit (unit KBytes/sec) each job write its own known hosts entry using ssh option HostKeyAliasOption affa --send-key w/o arguments sends the keys for all jobs removed Property StrictHostKeyChecking UPDATE FROM VERSIONS<8: run the command 'affa --send-key' to generate the known hosts entries for all jobs * Wed Dec 12 2007 Michael Weinberger Version 0.7.0 Modified logging: Job run logs to /var/log/affa/JOBNAME.log, all other to /var/log/affa/affa.log Bugfix: Check error status of --send-key and --revoke-key New: Options --show-schedule Modified: Option --list-archives now accepts multiple args or none Fix: install watchdog on source server before every run not only scheduled, to avoid watchdog triggered if a non-scheduled run take to long time. * Wed Nov 28 2007 Michael Weinberger Version 0.6.8 Bugfix: Automount was done too late. Daily backup never ran. * Wed Nov 21 2007 Michael Weinberger Version 0.6.7 Bugfix: Size and No. of files were not shown in --status Improved deleting of directories added --check-connections option Increased width of job column in --stats table * Sun Nov 11 2007 Michael Weinberger Version 0.6.6 Property rsync--modify-window added Modified recursive deleting directories * Wed Nov 07 2007 Michael Weinberger Version 0.6.5 ssh options added to scp commands added post-backup event * Wed Aug 08 2007 Michael Weinberger Version 0.6.4 delete dovcot index files after a --rise * Thu Jul 05 2007 Michael Weinberger Version 0.6.3 Bugfix: with RPMCheck=yes the affa-rpmlist was not found in the archive. Wrong path to schedule.0 instead of scheduled.running. Side effect of changes in version 0.5.0. [Bug 3128] * Tue Jul 03 2007 Michael Weinberger Version 0.6.2 Bugfix: Filesys::DiskFree requires $ENV{LANG}="en_US" [Bug 3119] Bug reported to bug-Filesys-DiskFree [at] rt.cpan.org * Mon Jun 25 2007 Michael Weinberger Version 0.6.1 Fix 3080 was not applied. * Mon Jun 18 2007 Michael Weinberger Version 0.6.0 - Replaced Filesys::DiskSpace by Filesys::DiskFree as the latter supports CIFS file system - using Filesys::DiskFree->mount and ->device instead of scanning /proc/mounts - mkdir RootDir only on job run to avoid making it in an unmounted mountpoint * Mon Jun 18 2007 Michael Weinberger Version 0.5.2 - Sending ssh key failed. When grep returned an error the mv command was not executed. Using ';' instead of '&&' for chaining commands. [Bug 3080] - /root/.ssh/authorized_keys2: No such file or directory warning. Run a touch to guarantee, that the file exists. [Bug 3080] - same issue with --revoke-key * Thu Jun 14 2007 Michael Weinberger Version 0.5.1 - Bugfix automount: getStatus() unmounts the device while a job is running - Status table: Last=never, if there are no archives at all * Tue Jun 12 2007 Michael Weinberger Version 0.5.0 - New property AutomountOptions - status table: grouped disabled jobs. Show Last='-' for disabled jobs instead of 'failed' - unlink lockfile in getLock() - Changes to improve robustness in case of network outage: - writing to a temporary archive scheduled.running and linkdest against the latest existing archive (usually scheduled.0). Then shift archives and rename scheduled.running to scheduled.0 - scheduledKeep=1 is now allowed - also check connection in daily,weekly etc., not only in scheduled run - don't run daily, weekly, monthly or yearly, when scheduled.0 doesn't exist. - new option --revoke-key - added optional option --revoke-key to --delete-job - avoid multiple adding public key to authorized_keys2 on source server * Wed Jun 06 2007 Michael Weinberger Version 0.4.7 - use StrictHostKeyChecking=no in sendKeys() * Tue Jun 05 2007 Michael Weinberger Version 0.4.6 - mailtest: Send also a testmail from the remotehost, when property Watchdog=yes - removed useless code in mailTestWatchdogRemote() * Mon Jun 04 2007 Michael Weinberger Version 0.4.5 write job config file to the archive dir * Thu May 31 2007 Michael Weinberger Version 0.4.4 - added property StrictHostKeyChecking (ssh option) - string comparison instead of numric for $job{'doneYearly'} ne $thisYear etc. * Wed May 30 2007 Michael Weinberger Version 0.4.3 - Minor bugfixes: calculation of RootDirFilesystemUsage in .AFFA-REPORT improved error handling with rsync status and df in DiskspaceWarn() * Thu May 29 2007 Michael Weinberger - Version 0.4.2 Infinite loop in execPostJobCommand() if command could not be executed: Don't call execPostJobCommand() in affaErrorExit() if err==115 - RPMCheck property was ignored - added Property chattyOnSuccess - modified jobconfig-sample.pl to preserve 'doneDaily','doneWeekly', 'doneMonthly','doneYearly' and 'chattyOnSuccess' - write error codes of affaErrorExit() to log * Thu May 24 2007 Michael Weinberger - Version 0.4.1 - fixed bug in disk usage calculation * Tue May 22 2007 Michael Weinberger - Version 0.4.0 - added option --rename-job - changed syntax of --send-keys - added option --move-archive * Sun May 20 2007 Michael Weinberger - Version 0.3.3 - rebuild cronjobs after rise/undorise - ignore job of own backup, when creating cronjobs (job appears after a rise run) * Sun May 20 2007 Michael Weinberger - Version 0.3.2 - man: added sshPort propperty - chdir /tmp to avoid cwd warnings when the cwd disappears while running rise or undo rise - bugfix: undorise() did not found own backup archive. Was searching for a wrong name * Wed May 16 2007 Michael Weinberger - Version 0.3.1 minor bugfixes - checkCrossFS() did not work (used in --rise) - jobconfig-sample.pl: deleting record before setting props - Perl errors with --status before a job run * Thu May 10 2007 Michael Weinberger - Version 0.3.0 - man page completed - mark archives with indices > keep setting with '*' in --list-acrchive output - Option --delete-job - Option --cleanup - added --job=JOB alternative to --send-keys * Wed May 09 2007 Michael Weinberger - Version 0.2.0 - added --mailtest option * Tue May 08 2007 Michael Weinberger - Version 0.1.5 - improved --status output - removed options --report and --send-report - added option --show-archives - added --csv for status and show-archives output in CSV format - added property 'sshPort' * Mon May 07 2007 Michael Weinberger - Version 0.1.4 - don't install the remote watchdog, when remotehost is eq localhost - improved check for remoteHostName eq localhost using DNS - ssh -o PasswordAuthentication=no in checkConnection() - added --full-restore - missing check for HOSTNAME argument in --send-keys added improved error check - prevent run of --rise of localhost from own backup * Mon Apr 30 2007 Michael Weinberger - Version 0.1.3 modified 'use constant* syntax in watchdog script for compatibility with perl 5.6 on SME6 * Fri Apr 27 2007 Michael Weinberger - Version 0.1.2 Bugfix: Preserve of ethernet driver setting with --rise did not work. Also preserve NIC bonding. * Mon Apr 23 2007 Michael Weinberger - Version 0.1.1 scheduledKeep must be>=2 for --link-dest set scheduledKeep to 2 if <2 - get lastrun date from affa-report rather than from report file - added auto mount function - added AutomountDevice and AutomountPoint to jobconfig-sample.pl * Wed Apr 18 2007 Michael Weinberger - Version 0.0.8 dont die if report db does not exist * Wed Apr 18 2007 Michael Weinberger - Version 0.0.7 run checkConnection() only for scheduled backups added Size and Disk usage information to --status * Tue Apr 17 2007 Michael Weinberger - Version 0.0.7 print Servername in --status output * Thu Apr 12 2007 Michael Weinberger - Version 0.0.5 fixed calculation of lastrun-now * Thu Apr 12 2007 Michael Weinberger - Version 0.0.4 - added --send-status plus templates - fixed format error of times in affa --status - show 'failed', if lastrun is older 1 day in affa --status - fixed typo. default status=disabled (was disable) * Fri Apr 06 2007 Michael Weinberger - Version 0.0.3 - watchdog reminder was not deleted on soure - wrong version mismatch list in rpm compare * Thu Apr 05 2007 Michael Weinberger - added 'rsync--inplace' property * Mon Apr 02 2007 Michael Weinberger - initial release %prep %setup -q -n %{name}-%{version} %build %install rm -rf $RPM_BUILD_ROOT rm -f %{name}-%{version}-filelist (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) perl createlinks $RPM_BUILD_ROOT rm -f %{name}-%{version}-filelist find $RPM_BUILD_ROOT -depth -type f -print |\ sed -e "s@^$RPM_BUILD_ROOT@@g" \ -e "s@^/sbin/e-smith/@%attr(0750,root,root) &@"\ -e "s@^/etc/profile.d/@%attr(0755,root,root) &@"\ -e "s@^/etc/e-smith/templates/@%attr(0644,root,root) &@"\ >> %{name}-%{version}-filelist find $RPM_BUILD_ROOT -depth -type l -print |\ sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT exit 0 %post /sbin/e-smith/db affa get AffaGlobalDisable > /dev/null || /sbin/e-smith/affa --make-cronjobs > /dev/null %files -f %{name}-%{version}-filelist %defattr(-,root,root)