You can subscribe to this list here.
2007 |
Jan
(76) |
Feb
(76) |
Mar
(54) |
Apr
(14) |
May
(23) |
Jun
(21) |
Jul
|
Aug
|
Sep
(9) |
Oct
(14) |
Nov
(12) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(18) |
Mar
(3) |
Apr
|
May
|
Jun
(2) |
Jul
(3) |
Aug
|
Sep
|
Oct
(17) |
Nov
(13) |
Dec
|
2009 |
Jan
(1) |
Feb
(1) |
Mar
(15) |
Apr
(2) |
May
(18) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(61) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
(18) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(4) |
Nov
(10) |
Dec
(9) |
2012 |
Jan
(10) |
Feb
(23) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
2013 |
Jan
(17) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <di...@us...> - 2011-03-06 17:50:59
|
Revision: 748 http://safekeep.svn.sourceforge.net/safekeep/?rev=748&view=rev Author: dimi Date: 2011-03-06 17:50:53 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Update version Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-03-06 17:50:08 UTC (rev 747) +++ safekeep/trunk/safekeep 2011-03-06 17:50:53 UTC (rev 748) @@ -68,7 +68,7 @@ cmd = "<Missing>" PROTOCOL = "1.1" -VERSION = "1.3.1" +VERSION = "1.3.2" VEBOSITY_BY_CLASS = {'DBG': 3, 'INFO': 2, 'WARN': 1, 'ERR': 0} ###################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:50:14
|
Revision: 747 http://safekeep.svn.sourceforge.net/safekeep/?rev=747&view=rev Author: dimi Date: 2011-03-06 17:50:08 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Better documentation on how to install from source Modified Paths: -------------- safekeep/trunk/INSTALL Modified: safekeep/trunk/INSTALL =================================================================== --- safekeep/trunk/INSTALL 2011-03-06 17:39:43 UTC (rev 746) +++ safekeep/trunk/INSTALL 2011-03-06 17:50:08 UTC (rev 747) @@ -11,10 +11,13 @@ $ make install -NOTE: installing this way is not equivalent to a package install. -You will have to manually create the safekeep user on the server, -and to setup the .ssh directory. +On the server side, you need to create the storage directory and user: + $ install -d -m 750 "/var/lib/safekeep" + $ install -d -m 700 "/var/lib/safekeep/.ssh" + $ groupadd -f -r safekeep + $ useradd -r -g safekeep -d /var/lib/safekeep -s /sbin/nologin safekeep + INSTALL NOTES ~~~~~~~~~~~~~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:39:50
|
Revision: 746 http://safekeep.svn.sourceforge.net/safekeep/?rev=746&view=rev Author: dimi Date: 2011-03-06 17:39:43 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Make the 'make install' behave more like the package install Modified Paths: -------------- safekeep/trunk/INSTALL safekeep/trunk/Makefile safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/INSTALL =================================================================== --- safekeep/trunk/INSTALL 2011-03-06 17:23:43 UTC (rev 745) +++ safekeep/trunk/INSTALL 2011-03-06 17:39:43 UTC (rev 746) @@ -12,17 +12,9 @@ $ make install NOTE: installing this way is not equivalent to a package install. -You will have to manually take care of a number of other -steps that are automatically taken care of by the packages such as -creating /etc/safekeep.d, installing the cron job script, creating -the safekeep user, and so on. +You will have to manually create the safekeep user on the server, +and to setup the .ssh directory. -Please make sure you understand all the ramifications of doing a -source install before you chose this option. Feel free to ask -questions on the mailing list: - saf...@li... -if you run into any problems. - INSTALL NOTES ~~~~~~~~~~~~~ Modified: safekeep/trunk/Makefile =================================================================== --- safekeep/trunk/Makefile 2011-03-06 17:23:43 UTC (rev 745) +++ safekeep/trunk/Makefile 2011-03-06 17:39:43 UTC (rev 746) @@ -97,12 +97,17 @@ svn log -v --xml | svn2log.py -D 0 -u doc/users install: - install -m 755 safekeep "/usr/bin/" - install -d -m 755 "/etc/safekeep/backup.d/" - install -m 755 safekeep.conf "/etc/safekeep/" - install -m 755 doc/safekeep.1 "/usr/share/man/man1/" - install -m 755 doc/safekeep.conf.5 "/usr/share/man/man5/" - install -m 755 doc/safekeep.backup.5 "/usr/share/man/man5/" + install -d -m 755 "$(DESTDIR)/usr/bin/" + install -m 755 $(name) "$(DESTDIR)/usr/bin/" + install -d -m 755 "$(DESTDIR)/etc/$(name)/backup.d" + install -m 664 $(name).conf "$(DESTDIR)/etc/$(name)/" + install -d -m 755 "$(DESTDIR)/etc/cron.daily" + install -m 755 $(name).cron "$(DESTDIR)/etc/cron.daily/$(name)" + install -d -m 755 "$(DESTDIR)/usr/share/man/man1/" + install -m 444 doc/$(name).1 "$(DESTDIR)/usr/share/man/man1/" + install -d -m 755 "$(DESTDIR)/usr/share/man/man5/" + install -m 444 doc/$(name).conf.5 "$(DESTDIR)/usr/share/man/man5/" + install -m 444 doc/$(name).backup.5 "$(DESTDIR)/usr/share/man/man5/" tar: svn export -r {'$(timestamp_svn)'} $(svnroot)/safekeep/trunk $(snapshotname) Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-03-06 17:23:43 UTC (rev 745) +++ safekeep/trunk/safekeep.spec.in 2011-03-06 17:39:43 UTC (rev 746) @@ -72,17 +72,7 @@ %install rm -rf %{buildroot} -install -d -m 755 "%{buildroot}%{_sysconfdir}/%{name}/backup.d" -install -m 664 %{name}.conf "%{buildroot}%{_sysconfdir}/%{name}/" -install -d -m 755 "%{buildroot}%{_sysconfdir}/cron.daily" -install -m 755 %{name}.cron "%{buildroot}%{_sysconfdir}/cron.daily/%{name}" -install -d -m 755 "%{buildroot}%{_bindir}/" -install -m 755 %{name} "%{buildroot}%{_bindir}/" -install -d -m 755 "%{buildroot}%{_mandir}/man1/" -install -m 444 doc/%{name}.1 "%{buildroot}%{_mandir}/man1/" -install -d -m 755 "%{buildroot}%{_mandir}/man5/" -install -m 444 doc/%{name}.conf.5 "%{buildroot}%{_mandir}/man5/" -install -m 444 doc/%{name}.backup.5 "%{buildroot}%{_mandir}/man5/" +make install DESTDIR=%{buildroot} install -d -m 750 "%{buildroot}%{homedir}" install -d -m 700 "%{buildroot}%{homedir}/.ssh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:23:49
|
Revision: 745 http://safekeep.svn.sourceforge.net/safekeep/?rev=745&view=rev Author: dimi Date: 2011-03-06 17:23:43 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Use the abstract name in the .spec file Modified Paths: -------------- safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-03-06 17:20:10 UTC (rev 744) +++ safekeep/trunk/safekeep.spec.in 2011-03-06 17:23:43 UTC (rev 745) @@ -10,7 +10,7 @@ Group: Applications/System License: GPLv2+ -URL: http://safekeep.sourceforge.net +URL: http://%{name}.sourceforge.net Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -40,7 +40,7 @@ Requires: openssh-server Requires: coreutils Requires: util-linux -Requires: safekeep-common = %{version}-%{release} +Requires: %{name}-common = %{version}-%{release} %description client SafeKeep is a client/server backup system which enhances the @@ -55,7 +55,7 @@ Requires(pre): %{_sbindir}/useradd Requires(pre): %{_sbindir}/groupadd Requires: openssh, openssh-clients -Requires: safekeep-common = %{version}-%{release} +Requires: %{name}-common = %{version}-%{release} %description server SafeKeep is a client/server backup system which enhances the @@ -72,17 +72,17 @@ %install rm -rf %{buildroot} -install -d -m 755 "%{buildroot}%{_sysconfdir}/safekeep/backup.d" -install -m 664 safekeep.conf "%{buildroot}%{_sysconfdir}/safekeep/" +install -d -m 755 "%{buildroot}%{_sysconfdir}/%{name}/backup.d" +install -m 664 %{name}.conf "%{buildroot}%{_sysconfdir}/%{name}/" install -d -m 755 "%{buildroot}%{_sysconfdir}/cron.daily" -install -m 755 safekeep.cron "%{buildroot}%{_sysconfdir}/cron.daily/safekeep" +install -m 755 %{name}.cron "%{buildroot}%{_sysconfdir}/cron.daily/%{name}" install -d -m 755 "%{buildroot}%{_bindir}/" -install -m 755 safekeep "%{buildroot}%{_bindir}/" +install -m 755 %{name} "%{buildroot}%{_bindir}/" install -d -m 755 "%{buildroot}%{_mandir}/man1/" -install -m 444 doc/safekeep.1 "%{buildroot}%{_mandir}/man1/" +install -m 444 doc/%{name}.1 "%{buildroot}%{_mandir}/man1/" install -d -m 755 "%{buildroot}%{_mandir}/man5/" -install -m 444 doc/safekeep.conf.5 "%{buildroot}%{_mandir}/man5/" -install -m 444 doc/safekeep.backup.5 "%{buildroot}%{_mandir}/man5/" +install -m 444 doc/%{name}.conf.5 "%{buildroot}%{_mandir}/man5/" +install -m 444 doc/%{name}.backup.5 "%{buildroot}%{_mandir}/man5/" install -d -m 750 "%{buildroot}%{homedir}" install -d -m 700 "%{buildroot}%{homedir}/.ssh" @@ -93,12 +93,12 @@ %{_sbindir}/groupadd -f -r %{name} id %{name} >/dev/null 2>&1 || \ %{_sbindir}/useradd -r -g %{name} -d %{homedir} -s /sbin/nologin \ - -c "Used by safekeep to run and store backups." %{name} + -c "Used by %{name} to run and store backups." %{name} %files common %defattr(-,root,root,-) -%{_bindir}/safekeep -%{_mandir}/man1/safekeep.1* +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.1* %doc AUTHORS COPYING LICENSE README INSTALL TODO samples/client-script-sample.sh %files client @@ -108,12 +108,12 @@ %defattr(-,root,root,-) %attr(750,%{name},%{name}) %dir %{homedir} %attr(700,%{name},%{name}) %dir %{homedir}/.ssh -%dir %{_sysconfdir}/safekeep -%dir %{_sysconfdir}/safekeep/backup.d -%config(noreplace) %{_sysconfdir}/safekeep/safekeep.conf -%{_sysconfdir}/cron.daily/safekeep -%{_mandir}/man5/safekeep.conf.5* -%{_mandir}/man5/safekeep.backup.5* +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/backup.d +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%{_sysconfdir}/cron.daily/%{name} +%{_mandir}/man5/%{name}.conf.5* +%{_mandir}/man5/%{name}.backup.5* %doc samples/sample.backup %changelog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:20:16
|
Revision: 744 http://safekeep.svn.sourceforge.net/safekeep/?rev=744&view=rev Author: dimi Date: 2011-03-06 17:20:10 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Move most installation related info to the INSTALL file Modified Paths: -------------- safekeep/trunk/INSTALL safekeep/trunk/README Modified: safekeep/trunk/INSTALL =================================================================== --- safekeep/trunk/INSTALL 2011-03-06 17:18:12 UTC (rev 743) +++ safekeep/trunk/INSTALL 2011-03-06 17:20:10 UTC (rev 744) @@ -17,6 +17,11 @@ creating /etc/safekeep.d, installing the cron job script, creating the safekeep user, and so on. +Please make sure you understand all the ramifications of doing a +source install before you chose this option. Feel free to ask +questions on the mailing list: + saf...@li... +if you run into any problems. INSTALL NOTES ~~~~~~~~~~~~~ Modified: safekeep/trunk/README =================================================================== --- safekeep/trunk/README 2011-03-06 17:18:12 UTC (rev 743) +++ safekeep/trunk/README 2011-03-06 17:20:10 UTC (rev 744) @@ -22,24 +22,10 @@ Install ~~~~~~~ It is recommended that you install the packaged version of SafeKeep, -via the provided RPMs or DEBs. However, if you can not use those -packages, or want to install from source, you can do so by running -as root the command: +via the provided RPMs or DEBs. - $ make install +For more installation related notes, please see the INSTALL file. -NOTE: installing SafeKeep this way is not equivalent to a package -install. You will have to manually take care of a number of other -steps that are automatically taken care of by the packages such as -creating /etc/safekeep.d, installing the cron job script, creating -the safekeep user, and so on. - -Please make sure you understand all the ramifications of doing a -source install before you chose this option. Feel free to ask -questions on the mailing list: - saf...@li... -if you run into any problems. - Full Test ~~~~~~~~~ To run the full test simply invoke the target: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:18:18
|
Revision: 743 http://safekeep.svn.sourceforge.net/safekeep/?rev=743&view=rev Author: dimi Date: 2011-03-06 17:18:12 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Add an INSTALL file based on the README.Fedora file provided by Frank Crawford <fr...@cr...>. The packaging explanation is common to all packaged versions of Safekeep, it's not Fedora specific. Modified Paths: -------------- safekeep/trunk/safekeep.spec.in Added Paths: ----------- safekeep/trunk/INSTALL Added: safekeep/trunk/INSTALL =================================================================== --- safekeep/trunk/INSTALL (rev 0) +++ safekeep/trunk/INSTALL 2011-03-06 17:18:12 UTC (rev 743) @@ -0,0 +1,42 @@ +PACKAGE INSTALL +~~~~~~~~~~~~~~~ + +It is highly recommended that you install the packaged version of +SafeKeep via the provided RPMs or DEBs. + + +SOURCE INSTALL +~~~~~~~~~~~~~~ +If you want to install from source, you can do so by running (as root): + + $ make install + +NOTE: installing this way is not equivalent to a package install. +You will have to manually take care of a number of other +steps that are automatically taken care of by the packages such as +creating /etc/safekeep.d, installing the cron job script, creating +the safekeep user, and so on. + + +INSTALL NOTES +~~~~~~~~~~~~~ + +Safekeep is designed such that the same script can be used on both the +backup server (which initiates backups from clients), as well as on +individual clients to handle client specific tasks such as +dedicated ssh key generation and client-side backup processes such as dump. + +As a result, safekeep is packaged in such a way that clients which want +to communicate with a safekeep managed backup server can choose to install +the safekeep-client subpackage to ensure correct safekeep client +configuration. This safekeep-client subpackage does not itself install any +additional files at this time. But it does ensure that the correct client +side applications are in place for safekeep managed backup services. + +It is recommended that all computers acting as safekeep clients install +the safekeep-client subpackage, even though at this time it is +technically optional if the necessary components such as an ssh server, +coreutils and util-linux are installed correctly on the client Fedora +system. In future version of safekeep the safekeep-client package may +become necessary for correct client operation. + Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-03-06 17:07:34 UTC (rev 742) +++ safekeep/trunk/safekeep.spec.in 2011-03-06 17:18:12 UTC (rev 743) @@ -99,7 +99,7 @@ %defattr(-,root,root,-) %{_bindir}/safekeep %{_mandir}/man1/safekeep.1* -%doc AUTHORS COPYING LICENSE README TODO samples/client-script-sample.sh +%doc AUTHORS COPYING LICENSE README INSTALL TODO samples/client-script-sample.sh %files client %defattr(-,root,root,-) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:07:40
|
Revision: 742 http://safekeep.svn.sourceforge.net/safekeep/?rev=742&view=rev Author: dimi Date: 2011-03-06 17:07:34 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Whitespace Modified Paths: -------------- safekeep/trunk/README Modified: safekeep/trunk/README =================================================================== --- safekeep/trunk/README 2011-03-06 17:06:55 UTC (rev 741) +++ safekeep/trunk/README 2011-03-06 17:07:34 UTC (rev 742) @@ -60,7 +60,7 @@ files like this: 192.168.4.128 safekeep-test-client 192.168.4.129 safekeep-test-server - + 3. At the moment, it is assumed that the VMs will run a RPM based distro, preferably Fedora Core 5. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-06 17:07:01
|
Revision: 741 http://safekeep.svn.sourceforge.net/safekeep/?rev=741&view=rev Author: dimi Date: 2011-03-06 17:06:55 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Frank Crawford <fr...@cr...> Add missing BuildRequire. Modified Paths: -------------- safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-03-03 16:19:11 UTC (rev 740) +++ safekeep/trunk/safekeep.spec.in 2011-03-06 17:06:55 UTC (rev 741) @@ -15,6 +15,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: xmlto, asciidoc > 6.0.3 %description SafeKeep is a client/server backup system which enhances the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-03 16:19:17
|
Revision: 740 http://safekeep.svn.sourceforge.net/safekeep/?rev=740&view=rev Author: dimi Date: 2011-03-03 16:19:11 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Bail if we can't read the .ssh/authorized_keys file while deploying keys. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-03-03 16:12:45 UTC (rev 739) +++ safekeep/trunk/safekeep 2011-03-03 16:19:11 UTC (rev 740) @@ -1224,8 +1224,8 @@ cmd = [basessh, '%s@%s' % (cfg['user'], cfg['host']), "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"] authtext = call(cmd) if authtext is None: - warn('%s: Failed to read the %s@%s:~/.ssh/authorized_keys file.' % (id, cfg['user'], cfg['host'])) - authtext = [] + error('%s: Failed to read the %s@%s:~/.ssh/authorized_keys file.' % (id, cfg['user'], cfg['host'])) + continue auth_keys = parse_authorized_keys(authtext) this_keys = parse_authorized_keys(output) new_keys = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-03 16:12:51
|
Revision: 739 http://safekeep.svn.sourceforge.net/safekeep/?rev=739&view=rev Author: dimi Date: 2011-03-03 16:12:45 +0000 (Thu, 03 Mar 2011) Log Message: ----------- A bit cleaner error message when we can't get to the authorized_keys file. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-03-03 15:58:54 UTC (rev 738) +++ safekeep/trunk/safekeep 2011-03-03 16:12:45 UTC (rev 739) @@ -1224,7 +1224,7 @@ cmd = [basessh, '%s@%s' % (cfg['user'], cfg['host']), "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"] authtext = call(cmd) if authtext is None: - warn('%s: Failed to read the authorized_keys file.' % id) + warn('%s: Failed to read the %s@%s:~/.ssh/authorized_keys file.' % (id, cfg['user'], cfg['host'])) authtext = [] auth_keys = parse_authorized_keys(authtext) this_keys = parse_authorized_keys(output) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-03 15:59:05
|
Revision: 738 http://safekeep.svn.sourceforge.net/safekeep/?rev=738&view=rev Author: dimi Date: 2011-03-03 15:58:54 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Oliver Henshaw <oli...@gm...> The 'authtext' caller can now use the output from call() without any further processing, and the 'output' caller needs only minor changes in preparation. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-03-03 15:57:48 UTC (rev 737) +++ safekeep/trunk/safekeep 2011-03-03 15:58:54 UTC (rev 738) @@ -1177,7 +1177,7 @@ cmds = ['safekeep --client', 'rdiff-backup --server --restrict-read-only /'] privatekeyfiles = [cfg.get('key_ctrl'), cfg.get('key_data')] - lines = [] + output = [] keys_ok = False for (cmd, privatekeyfile) in zip(cmds, privatekeyfiles): publickeyfile = privatekeyfile + '.pub' @@ -1207,14 +1207,13 @@ publickey = fin.read() fin.close() line = 'command="%s%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s' % (nice_cmd, cmd, publickey.strip()) - lines.append(line) + output.append(line) else: keys_ok = True if not keys_ok: continue - output = '\n'.join(lines) if dump: print output @@ -1227,7 +1226,7 @@ if authtext is None: warn('%s: Failed to read the authorized_keys file.' % id) authtext = [] - auth_keys = parse_authorized_keys(''.join(authtext)) + auth_keys = parse_authorized_keys(authtext) this_keys = parse_authorized_keys(output) new_keys = [] for this_key in this_keys: @@ -1253,7 +1252,7 @@ # parses authozied_keys, see sshd(8) man page for details def parse_authorized_keys(keystext): keys = [] - for line in keystext.splitlines(): + for line in keystext: line = line.strip() if not line or line[0] == '#': continue if line[0] in '0123456789': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-03 15:57:54
|
Revision: 737 http://safekeep.svn.sourceforge.net/safekeep/?rev=737&view=rev Author: dimi Date: 2011-03-03 15:57:48 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Oliver Henshaw <oli...@gm...> do_spawn wrongly returned stdout as a multi-line string, rather than the array of strings most callers were expecting. One caller was improperly converted from direct subprocess use to the call() wrapper, so its output is joined to one long string as a minimal fix. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-03-03 15:56:16 UTC (rev 736) +++ safekeep/trunk/safekeep 2011-03-03 15:57:48 UTC (rev 737) @@ -188,9 +188,9 @@ child_out.close() if use_subprocess: - return (proc.wait(), ''.join(lines)) + return (proc.wait(), lines) else: - return (0, ''.join(lines)) + return (0, lines) def _spawn(args, stdin=None, stdout=False): @@ -1226,8 +1226,8 @@ authtext = call(cmd) if authtext is None: warn('%s: Failed to read the authorized_keys file.' % id) - authtext = '' - auth_keys = parse_authorized_keys(authtext) + authtext = [] + auth_keys = parse_authorized_keys(''.join(authtext)) this_keys = parse_authorized_keys(output) new_keys = [] for this_key in this_keys: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-03-03 15:56:22
|
Revision: 736 http://safekeep.svn.sourceforge.net/safekeep/?rev=736&view=rev Author: dimi Date: 2011-03-03 15:56:16 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Oliver Henshaw <oli...@gm...> Only check the caller that could be null. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 05:52:35 UTC (rev 735) +++ safekeep/trunk/safekeep 2011-03-03 15:56:16 UTC (rev 736) @@ -1226,6 +1226,7 @@ authtext = call(cmd) if authtext is None: warn('%s: Failed to read the authorized_keys file.' % id) + authtext = '' auth_keys = parse_authorized_keys(authtext) this_keys = parse_authorized_keys(output) new_keys = [] @@ -1251,7 +1252,6 @@ # parses authozied_keys, see sshd(8) man page for details def parse_authorized_keys(keystext): - if not keystext: keystext = '' keys = [] for line in keystext.splitlines(): line = line.strip() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 05:52:41
|
Revision: 735 http://safekeep.svn.sourceforge.net/safekeep/?rev=735&view=rev Author: dimi Date: 2010-11-29 05:52:35 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Use trickle in a more compatible way Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:56:15 UTC (rev 734) +++ safekeep/trunk/safekeep 2010-11-29 05:52:35 UTC (rev 735) @@ -921,33 +921,32 @@ args.extend([ionice_cmd, '-c2', '-n%s' % (ionice), '-t']) else: warn('ionice(1) not available, ignoring ionice.adjustment') + + # handle bandwidth limiting via trickle + def get_bw(vals, d): + return vals.get(d) or vals.get('overall') + def get_bandwidth(cfg, d): + return get_bw(cfg['bw'], d) or get_bw(default_bandwidth, d) + trickle = [] + limit_dl = get_bandwidth(cfg, 'download') + limit_ul = get_bandwidth(cfg, 'upload') + if limit_dl or limit_ul: + trickle.extend([trickle_cmd]) + if verbosity_trickle: trickle.extend([verbosity_trickle]) + if limit_dl: + trickle.extend(['-d', str(limit_dl)]) + if limit_ul: + trickle.extend(['-u', str(limit_ul)]) + if len(trickle): + if not try_to_run([trickle_cmd, '-V']): + warn('Trickle not available, bandwidth limiting disabled') + trickle = [] + args.extend(trickle) args.extend(['rdiff-backup']) if cfg['host']: - trickle = '' - - def get_bw(vals, dir): - return vals.get(dir) or vals.get('overall') - - def get_bandwidth(cfg, dir): - return get_bw(cfg['bw'], dir) or get_bw(default_bandwidth, dir) - - limit_dl = get_bandwidth(cfg, 'download') - limit_ul = get_bandwidth(cfg, 'upload') - if limit_dl or limit_ul: - trickle = trickle_cmd + ' ' + verbosity_trickle - if limit_dl: - trickle += ' -d ' + str(limit_dl) - if limit_ul: - trickle += ' -u ' + str(limit_ul) - - if trickle: - if not try_to_run(trickle_cmd + ' -V'): - warn('Trickle not available, bandwidth limiting disabled') - trickle = '' - - schema = '%s ssh %s -i %s %%s rdiff-backup --server' % (trickle, verbosity_ssh, cfg['key_data']) + schema = 'ssh %s -i %s %%s rdiff-backup --server' % (verbosity_ssh, cfg['key_data']) args.extend(['--remote-schema', schema]) if force: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:56:21
|
Revision: 734 http://safekeep.svn.sourceforge.net/safekeep/?rev=734&view=rev Author: dimi Date: 2010-11-29 04:56:15 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Fix the interpretation of the status during the call(). Given up on explicit shell invokation when doing keys management. Better display during debug (when invoking external commands) Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:32:20 UTC (rev 733) +++ safekeep/trunk/safekeep 2010-11-29 04:56:15 UTC (rev 734) @@ -145,7 +145,11 @@ log(msg + extra, 'ERR') def do_spawn(args, stdin=None, stdout=False): - debug('Run [' + ' '.join(args) + ']') + if isinstance(args, types.StringTypes): + debug('Run [' + args + ']') + else: + debug('Run [' + ' '.join(args) + ']') + _shell = isinstance(args, types.StringTypes) if stdin: _stdin = PIPE @@ -225,7 +229,7 @@ # if it fails it returns None, otherwise it returns the output def call(args, stdin=None): rc, out = _spawn(args, stdin, stdout=True) - if not rc: + if rc: return None return out @@ -1219,7 +1223,7 @@ if identity: basessh += ' -i %s' % (commands.mkarg(identity)) if status or deploy: - cmd = '%s %s@%s "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"' % (basessh, cfg['user'], cfg['host']) + cmd = [basessh, '%s@%s' % (cfg['user'], cfg['host']), "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"] authtext = call(cmd) if authtext is None: warn('%s: Failed to read the authorized_keys file.' % id) @@ -1239,7 +1243,7 @@ if status: print '%s: Keys will be deployed on the client.' % id if deploy: - cmd = '%s %s@%s "umask 077; test -d .ssh || mkdir .ssh; cat >> .ssh/authorized_keys"' % (basessh, cfg['user'], cfg['host']) + cmd = [basessh, '%s@%s' % (cfg['user'], cfg['host']), "umask 077; test -d .ssh || mkdir .ssh; cat >> .ssh/authorized_keys"] keys = '%s\n' % '\n'.join([key[4] for key in new_keys]) out = call(cmd, stdin=keys) if out is None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:32:26
|
Revision: 733 http://safekeep.svn.sourceforge.net/safekeep/?rev=733&view=rev Author: dimi Date: 2010-11-29 04:32:20 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Avoid NPE Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:29:09 UTC (rev 732) +++ safekeep/trunk/safekeep 2010-11-29 04:32:20 UTC (rev 733) @@ -1248,6 +1248,7 @@ # parses authozied_keys, see sshd(8) man page for details def parse_authorized_keys(keystext): + if not keystext: keystext = '' keys = [] for line in keystext.splitlines(): line = line.strip() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:29:15
|
Revision: 732 http://safekeep.svn.sourceforge.net/safekeep/?rev=732&view=rev Author: dimi Date: 2010-11-29 04:29:09 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Hide output when trying an external command Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:26:08 UTC (rev 731) +++ safekeep/trunk/safekeep 2010-11-29 04:29:09 UTC (rev 732) @@ -231,7 +231,7 @@ def try_to_run(args): try: - rc, out = do_spawn(args) + rc, out = do_spawn(args, None, True) except OSError, ex: return False return rc in (0,1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:26:14
|
Revision: 731 http://safekeep.svn.sourceforge.net/safekeep/?rev=731&view=rev Author: dimi Date: 2010-11-29 04:26:08 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Avoid errors when ionice is an integer Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:19:55 UTC (rev 730) +++ safekeep/trunk/safekeep 2010-11-29 04:26:08 UTC (rev 731) @@ -914,7 +914,7 @@ if ionice is 'idle': args.extend([ionice_cmd, '-c3', '-t']) else: - args.extend([ionice_cmd, '-c2', '-n' + ionice, '-t']) + args.extend([ionice_cmd, '-c2', '-n%s' % (ionice), '-t']) else: warn('ionice(1) not available, ignoring ionice.adjustment') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:20:00
|
Revision: 730 http://safekeep.svn.sourceforge.net/safekeep/?rev=730&view=rev Author: dimi Date: 2010-11-29 04:19:55 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Do not die if we can't set effective UID, just issue a warning Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:16:54 UTC (rev 729) +++ safekeep/trunk/safekeep 2010-11-29 04:19:55 UTC (rev 730) @@ -1507,8 +1507,11 @@ if backup_user and backup_user != work_user: (user, pswd, uid, gid, gecos, home_dir, shell) = pwd.getpwnam(backup_user) if mode is not 'keys': - os.setregid(gid, gid) - os.setreuid(uid, uid) + try: + os.setregid(gid, gid) + os.setreuid(uid, uid) + except OSError, ex: + warn("Cannot setreuid(): " + str(ex)) os.environ['HOME'] = home_dir else: backup_user = work_user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:17:00
|
Revision: 729 http://safekeep.svn.sourceforge.net/safekeep/?rev=729&view=rev Author: dimi Date: 2010-11-29 04:16:54 +0000 (Mon, 29 Nov 2010) Log Message: ----------- ionice is not necessarily an integer Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-29 04:15:41 UTC (rev 728) +++ safekeep/trunk/safekeep 2010-11-29 04:16:54 UTC (rev 729) @@ -1491,7 +1491,7 @@ if nice_def is None: nice_def = 10 nice_srv = get_int('nice.adjustment.server') or nice_def nice_cln = get_int('nice.adjustment.client') or nice_def - ionice_def = get_int('ionice.adjustment') + ionice_def = props.get('ionice.adjustment') if ionice_def is None: ionice_def = 'idle' if ionice_def is '': ionice_def = 'none' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-29 04:15:47
|
Revision: 728 http://safekeep.svn.sourceforge.net/safekeep/?rev=728&view=rev Author: dimi Date: 2010-11-29 04:15:41 +0000 (Mon, 29 Nov 2010) Log Message: ----------- Fix link to website path Modified Paths: -------------- safekeep/trunk/Makefile Modified: safekeep/trunk/Makefile =================================================================== --- safekeep/trunk/Makefile 2010-11-23 04:49:48 UTC (rev 727) +++ safekeep/trunk/Makefile 2010-11-29 04:15:41 UTC (rev 728) @@ -18,7 +18,7 @@ releasedir := releases repo_srv := root@ulysses repo_dir := /var/www/repos/lattica -webroot := ../../website/trunk/WebContent/ +webroot := ../website/WebContent/ MAN_TXT := doc/safekeep.txt doc/safekeep.conf.txt doc/safekeep.backup.txt DOC_MAN := doc/safekeep.1 doc/safekeep.conf.5 doc/safekeep.backup.5 DOC_HTML := $(patsubst %.txt,%.html,$(MAN_TXT)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-23 04:49:57
|
Revision: 727 http://safekeep.svn.sourceforge.net/safekeep/?rev=727&view=rev Author: dimi Date: 2010-11-23 04:49:48 +0000 (Tue, 23 Nov 2010) Log Message: ----------- Announce release on our website Modified Paths: -------------- website/trunk/WebContent/download.shtml website/trunk/WebContent/index.shtml website/trunk/WebContent/news.shtml website/trunk/WebContent/releases.shtml Modified: website/trunk/WebContent/download.shtml =================================================================== --- website/trunk/WebContent/download.shtml 2010-11-23 04:30:09 UTC (rev 726) +++ website/trunk/WebContent/download.shtml 2010-11-23 04:49:48 UTC (rev 727) @@ -13,13 +13,17 @@ <a name="releases"></a> <h2>Releases</h2> -<a name="1.2.1"></a> +<a name="1.3.1"></a> <p> -<a href="http://sourceforge.net/project/showfiles.php?group_id=185128&package_id=215518&release_id=684234">SafeKeep 1.2.1</a> -was released May 21, 2009, containing the following main features: +<a href="https://sourceforge.net/projects/safekeep/files/safekeep/1.3.1/">SafeKeep 1.3.1</a> +was released Nov 22, 2010, containing the following main features: </p> <ul> + <li>Ability to nice(1) both servers and clients for nicer CPU behaviour.</li> + <li>Ability to ionice(1) the server for nicer IO behaviour.</li> <li>Portability fixes to news versions of python.</li> + <li>Much better reporting or messages, errors, etc from clients.</li> + <li>Many cleanups, bug fixes, and smaller improvements.</li> </ul> <table> <tr> @@ -33,12 +37,12 @@ <b>Red Hat / Fedora</b> binary and source .rpms for RedHat EL, Cent OS, Fedora and compatible distributions. </td> <td> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.2.1-1.src.rpm">safekeep-1.2.1-1.src.rpm</a> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.1-1.src.rpm">safekeep-1.3.1-1.src.rpm</a> </td> <td> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.2.1-1.noarch.rpm">safekeep-common-1.2.1-1.noarch.rpm</a> <br> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.2.1-1.noarch.rpm">safekeep-client-1.2.1-1.noarch.rpm</a> <br> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.2.1-1.noarch.rpm">safekeep-server-1.2.1-1.noarch.rpm</a> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.3.1-1.noarch.rpm">safekeep-common-1.3.1-1.noarch.rpm</a> <br> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.1-1.noarch.rpm">safekeep-client-1.3.1-1.noarch.rpm</a> <br> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.1-1.noarch.rpm">safekeep-server-1.3.1-1.noarch.rpm</a> </td> </tr> <tr> @@ -46,15 +50,15 @@ <img src="images/ubuntu.png" width="50" height="50" alt="Ubuntu Linux" border="0"> </td> <td> - <b>Ubuntu</b> binary and source .debs for Ubuntu Hardy, Gutsy, Edgy, Dapper, and Breezy + <b>Ubuntu</b> binary and source .debs for Ubuntu Hardy, Gutsy, Edgy, Dapper, Breezy, etc. </td> <td> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.2.1.tar.gz">safekeep-1.2.1.tar.gz</a> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.1.tar.gz">safekeep-1.3.1.tar.gz</a> </td> <td> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.2.1_all.deb">safekeep-common_1.2.1_all.deb</a> <br> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.2.1_all.deb">safekeep-client_1.2.1_all.deb</a> <br> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.2.1_all.deb">safekeep-server_1.2.1_all.deb</a> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.1_all.deb">safekeep-common_1.3.1_all.deb</a> <br> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.1_all.deb">safekeep-client_1.3.1_all.deb</a> <br> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.1_all.deb">safekeep-server_1.3.1_all.deb</a> </td> </tr> <tr> @@ -62,10 +66,10 @@ <img src="images/linux.png" width="50" height="50" alt="Linux Source" border="0"> </td> <td> - <b>Linux</b> source tarball for most distributions running Python 2.4 or newer + <b>Linux</b> source tarball for most distributions running Python 2.2 or newer </td> <td> - <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.2.1.tar.gz">safekeep-1.2.1.tar.gz</a> + <a href="http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.1.tar.gz">safekeep-1.3.1.tar.gz</a> </td> <td> N/A Modified: website/trunk/WebContent/index.shtml =================================================================== --- website/trunk/WebContent/index.shtml 2010-11-23 04:30:09 UTC (rev 726) +++ website/trunk/WebContent/index.shtml 2010-11-23 04:49:48 UTC (rev 727) @@ -39,15 +39,19 @@ <div class="NewsBox"> -<p class="NewsTitle">May 21, 2009: SafeKeep version 1.2.1 (stable) released +<p class="NewsTitle">Nov 22, 2010: SafeKeep version 1.3.1 (stable) released <img src="images/grey_pixel.gif" width="100%" height="1" alt=""> </p> <blockquote> <p> -SafeKeep 1.2.1 was released today. What's new in this release: +SafeKeep 1.3.1 was released today. What's new in this release: </p> <ul> + <li>Ability to nice(1) both servers and clients for nicer CPU behaviour.</li> + <li>Ability to ionice(1) the server for nicer IO behaviour.</li> <li>Portability fixes to news versions of python.</li> + <li>Much better reporting or messages, errors, etc from clients.</li> + <li>Many cleanups, bug fixes, and smaller improvements.</li> </ul> <p> Binary packages for RedHat-based (e.g. RedHat EL, CentOS, Fedora) Modified: website/trunk/WebContent/news.shtml =================================================================== --- website/trunk/WebContent/news.shtml 2010-11-23 04:30:09 UTC (rev 726) +++ website/trunk/WebContent/news.shtml 2010-11-23 04:49:48 UTC (rev 727) @@ -5,6 +5,27 @@ <div class="NewsBox"> +<p class="NewsTitle">Nov 22, 2010: SafeKeep version 1.3.1 (stable) released +<img src="images/grey_pixel.gif" width="100%" height="1" alt=""> +</p> +<blockquote> +<p> +SafeKeep 1.3.1 was released today. What's new in this release: +</p> +<ul> + <li>Ability to nice(1) both servers and clients for nicer CPU behaviour.</li> + <li>Ability to ionice(1) the server for nicer IO behaviour.</li> + <li>Portability fixes to news versions of python.</li> + <li>Much better reporting or messages, errors, etc from clients.</li> + <li>Many cleanups, bug fixes, and smaller improvements.</li> +</ul> +<p> +Binary packages for RedHat-based (e.g. RedHat EL, CentOS, Fedora) +and Debian-based (e.g. Debian, Ubuntu) distributions are available +for immediate <a href="download.shtml">download ...</a> +</p> +</blockquote> + <p class="NewsTitle">May 21, 2009: SafeKeep version 1.2.1 (stable) released <img src="images/grey_pixel.gif" width="100%" height="1" alt=""> </p> Modified: website/trunk/WebContent/releases.shtml =================================================================== --- website/trunk/WebContent/releases.shtml 2010-11-23 04:30:09 UTC (rev 726) +++ website/trunk/WebContent/releases.shtml 2010-11-23 04:49:48 UTC (rev 727) @@ -4,7 +4,8 @@ <h1>Releases</h1> <div id="PageMenu"> <span class="PageMenuTitle">On This Page:</span> - <a href="#1.2.0">1.2.1</a> + <a href="#1.3.1">1.3.1</a> + <a href="#1.2.1">1.2.1</a> <a href="#1.2.0">1.2.0</a> <a href="#1.0.5">1.0.5</a> <a href="#1.0.4">1.0.4</a> @@ -17,6 +18,19 @@ <a href="#0.9.0">0.9.0</a> </div> +<a name="1.3.1"></a> +<p> +<a href="https://sourceforge.net/projects/safekeep/files/safekeep/1.3.1/">SafeKeep 1.3.1</a> +was released Nov 22, 2010, containing the following main features: +</p> +<ul> + <li>Ability to nice(1) both servers and clients for nicer CPU behaviour.</li> + <li>Ability to ionice(1) the server for nicer IO behaviour.</li> + <li>Portability fixes to news versions of python.</li> + <li>Much better reporting or messages, errors, etc from clients.</li> + <li>Many cleanups, bug fixes, and smaller improvements.</li> +</ul> + <a name="1.2.1"></a> <p> <a href="http://sourceforge.net/project/showfiles.php?group_id=185128&package_id=215518&release_id=684234">SafeKeep 1.2.1</a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-23 04:30:16
|
Revision: 726 http://safekeep.svn.sourceforge.net/safekeep/?rev=726&view=rev Author: dimi Date: 2010-11-23 04:30:09 +0000 (Tue, 23 Nov 2010) Log Message: ----------- Update man pages on website to latest as of Mon Nov 22 23:29:59 EST 2010 Modified Paths: -------------- website/trunk/WebContent/safekeep.backup.html website/trunk/WebContent/safekeep.conf.html website/trunk/WebContent/safekeep.html Modified: website/trunk/WebContent/safekeep.backup.html =================================================================== --- website/trunk/WebContent/safekeep.backup.html 2010-11-23 04:13:03 UTC (rev 725) +++ website/trunk/WebContent/safekeep.backup.html 2010-11-23 04:30:09 UTC (rev 726) @@ -2,7 +2,7 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta name="generator" content="AsciiDoc 8.4.1"> +<meta name="generator" content="AsciiDoc 8.4.5"> <title>safekeep.backup</title> </head> <body> @@ -15,7 +15,7 @@ <p>safekeep.backup - Configuration file for a 'safekeep(1)' client </p> -<h2>SYNOPSIS</h2> +<h2><a name="_synopsis"></a>SYNOPSIS</h2> <p>These files are usually placed in <tt>/etc/safekeep/backup.d/</tt> to be picked up automatically by <b>safekeep(1)</b>. They must have a <tt>.backup</tt> extension.</p> <h2><a name="_description"></a>DESCRIPTION</h2> @@ -31,7 +31,7 @@ <!-- the client backup host, the user under which the servers will connect, the SSH keys used for control and data transfer --> <host - name="myhost" user="root" + name="myhost" user="root" nice="10" key-ctrl="/home/jdoe/.ssh/backup_id_dsa" key-data="/home/jdoe/.ssh/backup2_id_dsa" /> @@ -138,6 +138,17 @@ </p> </dd> <dt> +/backup/host/@nice +</dt> +<dd> +<p> + The nice adjustment for the client. This settings is normally + not all that important, as most of the load rests on the server side. + NB: if you change this value, you will have to re-deploy the auth keys. + Optional, defaults to no nice level. +</p> +</dd> +<dt> /backup/host/@key-ctrl </dt> <dd> @@ -563,7 +574,7 @@ <p></p> <p></p> <hr><p><small> -Last updated 2009-05-21 11:18:36 EDT +Last updated 2010-11-19 01:25:42 EDT </small></p> </body> </html> Modified: website/trunk/WebContent/safekeep.conf.html =================================================================== --- website/trunk/WebContent/safekeep.conf.html 2010-11-23 04:13:03 UTC (rev 725) +++ website/trunk/WebContent/safekeep.conf.html 2010-11-23 04:30:09 UTC (rev 726) @@ -2,7 +2,7 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta name="generator" content="AsciiDoc 8.4.1"> +<meta name="generator" content="AsciiDoc 8.4.5"> <title>safekeep.conf</title> </head> <body> @@ -15,7 +15,7 @@ <p>safekeep.conf - Configuration file for 'safekeep(1)' </p> -<h2>SYNOPSIS</h2> +<h2><a name="_synopsis"></a>SYNOPSIS</h2> <p>This file resides in <tt>/etc/safekeep/</tt> from where it will be automatically picked up by <b>safekeep(1)</b>.</p> <h2><a name="_description"></a>DESCRIPTION</h2> @@ -75,15 +75,52 @@ </dt> <dd> <p> - The nice level adjustment for safekeep, for the time - being used only on the server side. + The default nice level adjustment for safekeep. It specifies an integer to be added to the current nice level. Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable). - If no nice level is specified, safekeep is not niced. + To disable nice, set this value to 0. + If no nice level is specified, safekeep is niced at +10. </p> </dd> <dt> +nice.adjustment.server +</dt> +<dd> +<p> + The nice level adjustment for safekeep, used on the server side. + It overrides the generic setting in nice.adjustment. +</p> +</dd> +<dt> +nice.adjustment.client +</dt> +<dd> +<p> + The default nice adjustment for the client. This settings is normally + not all that important, as most of the load is on the server side. + You can also set the remove nice level on a per-client basis in + the .backup file (see /backup/host/@nice). + NB: if you change this value, you will have to re-deploy the auth keys. +</p> +</dd> +<dt> +ionice.adjustment +</dt> +<dd> +<p> + The default IO nice level adjustment for safekeep. + It can be either <b>none</b>, <b>idle</b>, or an integer between 0-7 + (with 0 being higher priority). See ionice(1) for more information. + This is currently being used only on the server side, where + IO load tends to be a problem. + NB: this depends on the availability of <b>ionice(1)</b> on the + system where the server is running. If ionice cannot be found, + this setting is ignored. + If no level is specified, it defaults to <b>idle</b>. +</p> +</dd> +<dt> bandwidth.overall </dt> <dd> @@ -135,7 +172,7 @@ <p></p> <p></p> <hr><p><small> -Last updated 2009-05-21 11:18:36 EDT +Last updated 2010-11-21 14:01:30 EDT </small></p> </body> </html> Modified: website/trunk/WebContent/safekeep.html =================================================================== --- website/trunk/WebContent/safekeep.html 2010-11-23 04:13:03 UTC (rev 725) +++ website/trunk/WebContent/safekeep.html 2010-11-23 04:30:09 UTC (rev 726) @@ -1,27 +1,328 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta name="generator" content="AsciiDoc 8.4.1"> -<title>safekeep</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<meta name="generator" content="AsciiDoc 8.2.2" /> +<style type="text/css"> +/* Debug borders */ +p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { +/* + border: 1px solid red; +*/ +} + +body { + margin: 1em 5% 1em 5%; +} + +a { + color: blue; + text-decoration: underline; +} +a:visited { + color: fuchsia; +} + +em { + font-style: italic; +} + +strong { + font-weight: bold; +} + +tt { + color: navy; +} + +h1, h2, h3, h4, h5, h6 { + color: #527bbd; + font-family: sans-serif; + margin-top: 1.2em; + margin-bottom: 0.5em; + line-height: 1.3; +} + +h1 { + border-bottom: 2px solid silver; +} +h2 { + border-bottom: 2px solid silver; + padding-top: 0.5em; +} + +div.sectionbody { + font-family: serif; + margin-left: 0; +} + +hr { + border: 1px solid silver; +} + +p { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +pre { + padding: 0; + margin: 0; +} + +span#author { + color: #527bbd; + font-family: sans-serif; + font-weight: bold; + font-size: 1.1em; +} +span#email { +} +span#revision { + font-family: sans-serif; +} + +div#footer { + font-family: sans-serif; + font-size: small; + border-top: 2px solid silver; + padding-top: 0.5em; + margin-top: 4.0em; +} +div#footer-text { + float: left; + padding-bottom: 0.5em; +} +div#footer-badges { + float: right; + padding-bottom: 0.5em; +} + +div#preamble, +div.tableblock, div.imageblock, div.exampleblock, div.verseblock, +div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, +div.admonitionblock { + margin-right: 10%; + margin-top: 1.5em; + margin-bottom: 1.5em; +} +div.admonitionblock { + margin-top: 2.5em; + margin-bottom: 2.5em; +} + +div.content { /* Block element content. */ + padding: 0; +} + +/* Block element titles. */ +div.title, caption.title { + font-family: sans-serif; + font-weight: bold; + text-align: left; + margin-top: 1.0em; + margin-bottom: 0.5em; +} +div.title + * { + margin-top: 0; +} + +td div.title:first-child { + margin-top: 0.0em; +} +div.content div.title:first-child { + margin-top: 0.0em; +} +div.content + div.title { + margin-top: 0.0em; +} + +div.sidebarblock > div.content { + background: #ffffee; + border: 1px solid silver; + padding: 0.5em; +} + +div.listingblock { + margin-right: 0%; +} +div.listingblock > div.content { + border: 1px solid silver; + background: #f4f4f4; + padding: 0.5em; +} + +div.quoteblock > div.content { + padding-left: 2.0em; +} + +div.attribution { + text-align: right; +} +div.verseblock + div.attribution { + text-align: left; +} + +div.admonitionblock .icon { + vertical-align: top; + font-size: 1.1em; + font-weight: bold; + text-decoration: underline; + color: #527bbd; + padding-right: 0.5em; +} +div.admonitionblock td.content { + padding-left: 0.5em; + border-left: 2px solid silver; +} + +div.exampleblock > div.content { + border-left: 2px solid silver; + padding: 0.5em; +} + +div.verseblock div.content { + white-space: pre; +} + +div.imageblock div.content { padding-left: 0; } +div.imageblock img { border: 1px solid silver; } +span.image img { border-style: none; } + +dl { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +dt { + margin-top: 0.5em; + margin-bottom: 0; + font-style: italic; +} +dd > *:first-child { + margin-top: 0; +} + +ul, ol { + list-style-position: outside; +} +ol.olist2 { + list-style-type: lower-alpha; +} + +div.tableblock > table { + border: 3px solid #527bbd; +} +thead { + font-family: sans-serif; + font-weight: bold; +} +tfoot { + font-weight: bold; +} + +div.hlist { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +div.hlist td { + padding-bottom: 5px; +} +td.hlist1 { + vertical-align: top; + font-style: italic; + padding-right: 0.8em; +} +td.hlist2 { + vertical-align: top; +} + +@media print { + div#footer-badges { display: none; } +} + +div#toctitle { + color: #527bbd; + font-family: sans-serif; + font-size: 1.1em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { + margin-top: 0; + margin-bottom: 0; +} +div.toclevel2 { + margin-left: 2em; + font-size: 0.9em; +} +div.toclevel3 { + margin-left: 4em; + font-size: 0.9em; +} +div.toclevel4 { + margin-left: 6em; + font-size: 0.9em; +} +include1::./stylesheets/xhtml11-manpage.css[] +/* Workarounds for IE6's broken and incomplete CSS2. */ + +div.sidebar-content { + background: #ffffee; + border: 1px solid silver; + padding: 0.5em; +} +div.sidebar-title, div.image-title { + font-family: sans-serif; + font-weight: bold; + margin-top: 0.0em; + margin-bottom: 0.5em; +} + +div.listingblock div.content { + border: 1px solid silver; + background: #f4f4f4; + padding: 0.5em; +} + +div.quoteblock-content { + padding-left: 2.0em; +} + +div.exampleblock-content { + border-left: 2px solid silver; + padding-left: 0.5em; +} + +/* IE6 sets dynamically generated links as visited. */ +div#toc a:visited { color: blue; } +</style> +<title>safekeep(1)</title> </head> <body> -<hr> +<div id="header"> <h1> - safekeep(1) Manual Page +safekeep(1) Manual Page </h1> -<hr> <h2>NAME</h2> +<div class="sectionbody"> <p>safekeep - Client/server backup script </p> +</div> +</div> <h2>SYNOPSIS</h2> -<p><b>safekeep</b> --server [-q] [-v] [--noemail] [--force] [-c file] [--cleanup] <clientid>*</p> -<p><b>safekeep</b> --keys [-q] [-v] [--noemail] [-c file] [-i file] [--status] [--print] [--deploy] <clientid>*</p> -<p><b>safekeep</b> --list [-q] [-v] [--noemail] [-c file] [--increments] [--parsable-output] [--sizes] [--changed=<time>] [--at-time=<time>] <clientid>*</p> -<p><b>safekeep</b> --client [--cleanup]</p> -<p><b>safekeep</b> -h | -V</p> -<h2><a name="_description"></a>DESCRIPTION</h2> +<div class="sectionbody"> +<p><em>safekeep</em> --server [-q] [-v] [--noemail] [--force] [-c file] [--cleanup] <clientid>*</p> +<p><em>safekeep</em> --keys [-q] [-v] [--noemail] [-c file] [-i file] [--status] [--print] [--deploy] <clientid>*</p> +<p><em>safekeep</em> --list [-q] [-v] [--noemail] [-c file] [--increments] [--parsable-output] [--sizes] [--changed=<time>] [--at-time=<time>] <clientid>*</p> +<p><em>safekeep</em> --client [--cleanup]</p> +<p><em>safekeep</em> -h | -V</p> +</div> +<h2>DESCRIPTION</h2> +<div class="sectionbody"> <p>SafeKeep is a client/server backup script which enhances the power of rdiff-backup with simple configuration and use.</p> <p>SafeKeep can work in server mode, client mode, SSH key management mode @@ -53,7 +354,9 @@ arguments. If no client ID is given, SafeKeep will operate over all known clients.</p> <p>Each mode accepts a few options as described below.</p> -<h2><a name="_operation_mode"></a>OPERATION MODE</h2> +</div> +<h2>OPERATION MODE</h2> +<div class="sectionbody"> <dl> <dt> --server @@ -93,7 +396,9 @@ <p>Please note that you must always specify an operation mode. Earlier versions used do default to <tt>--server</tt> mode, but that proved to work out poorly in practice.</p> -<h2><a name="_general_options"></a>GENERAL OPTIONS</h2> +</div> +<h2>GENERAL OPTIONS</h2> +<div class="sectionbody"> <dl> <dt> -c, --conf=FILE @@ -152,7 +457,9 @@ </p> </dd> </dl> -<h2><a name="_server_options"></a>SERVER OPTIONS</h2> +</div> +<h2>SERVER OPTIONS</h2> +<div class="sectionbody"> <dl> <dt> --force @@ -181,7 +488,9 @@ </p> </dd> </dl> -<h2><a name="_client_options"></a>CLIENT OPTIONS</h2> +</div> +<h2>CLIENT OPTIONS</h2> +<div class="sectionbody"> <dl> <dt> --cleanup @@ -197,7 +506,9 @@ </p> </dd> </dl> -<h2><a name="_keys_options"></a>KEYS OPTIONS</h2> +</div> +<h2>KEYS OPTIONS</h2> +<div class="sectionbody"> <dl> <dt> -i FILE @@ -225,7 +536,7 @@ <dd> <p> Display the authorization keys for the clients. This is useful in - case you want to manually copy it into the client’s + case you want to manually copy it into the client's <tt>~/.ssh/authorized_keys</tt> file. This option is seldom useful. </p> </dd> @@ -238,7 +549,9 @@ </p> </dd> </dl> -<h2><a name="_list_options"></a>LIST OPTIONS</h2> +</div> +<h2>LIST OPTIONS</h2> +<div class="sectionbody"> <dl> <dt> --increments @@ -295,21 +608,25 @@ </p> </dd> </dl> -<h2><a name="_configuration"></a>CONFIGURATION</h2> +</div> +<h2>CONFIGURATION</h2> +<div class="sectionbody"> <p>Normally the configuration files are placed in the <tt>/etc/safekeep/backup.d/</tt> directory from where they will get picked up automatically by SafeKeep. Each backup client is described by a configuration file in XML format. The minimum configuration file is:</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre><backup> +<div class="listingblock"> +<div class="content"> +<pre><tt><backup> <host name="my_workstation" /> -</backup></pre> -</td></tr></table> +</backup></tt></pre> +</div></div> <p>This will simply backup all relevant files (excluding temporary files, caches, etc) from the client with the address <tt>my_workstation</tt>.</p> <p>A more realistic example:</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre><backup> +<div class="listingblock"> +<div class="content"> +<pre><tt><backup> <host name="my_workstation" /> <repo retention="10D" /> <setup> @@ -343,34 +660,41 @@ <exclude path="/"/> </data> -</backup></pre> -</td></tr></table> +</backup></tt></pre> +</div></div> <p>In this case, SafeKeep will dump all databases managed by PostgreSQL, snapshot the disk via LVM, and proceed to backup <tt>/etc</tt>, <tt>/home</tt>, <tt>/root</tt>, <tt>/srv</tt>, <tt>/var</tt>, while excluding some unneeded files and directories. Older data will be retained for 10 days.</p> <p>For full reference documentation of the configuration format, see safekeep.backup(5).</p> -<h2><a name="_client_ids"></a>CLIENT IDS</h2> +</div> +<h2>CLIENT IDS</h2> +<div class="sectionbody"> <p>Normally the client IDs are generated automatically from the configuration filenames without the extension. E.g. if a configuration file is named <tt>my_workstation.conf</tt>, the client ID becomes <tt>my_workstation</tt>. For more information on this topic, see safekeep.backup(5).</p> -<h2><a name="_key_deployment"></a>KEY DEPLOYMENT</h2> +</div> +<h2>KEY DEPLOYMENT</h2> +<div class="sectionbody"> <p>The <tt>safekeep(1)</tt> server needs to access the clients in order to conduct the backup. To that end, it establishes two ssh(1) pipes: one for control, and one for data. To simplify the deployment of the keys, <tt>safekeep(1)</tt> has a key deploy mode.</p> <p>When deploying keys using the built-in key management functionality, <tt>safekeep(1)</tt> needs to be invoked as the user under which it will function -as a server. By default, that user is <b>safekeep</b>. For extra security, +as a server. By default, that user is <em>safekeep</em>. For extra security, you can not login into that account, so you have to invoke <tt>safekeep(1)</tt> -as <b>root</b>:</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre> [root@yourbox ~] # safekeep --keys --deploy</pre> -</td></tr></table> -<h2><a name="_restoring"></a>RESTORING</h2> -<p>Since <tt>safekeep(1)</tt> is built around <tt>rdiff-backup(1)</tt>, it doesn’t have any +as <em>root</em>:</p> +<div class="listingblock"> +<div class="content"> +<pre><tt> [root@yourbox ~] # safekeep --keys --deploy</tt></pre> +</div></div> +</div> +<h2>RESTORING</h2> +<div class="sectionbody"> +<p>Since <tt>safekeep(1)</tt> is built around <tt>rdiff-backup(1)</tt>, it doesn't have any built-in restore capabilities. It simply relies on <tt>rdiff-backup</tt> to perform this task.</p> <p>To do so, you just need to know the directory where the data is actually @@ -378,44 +702,54 @@ <tt>/etc/safekeep/backup.d/mybox.backup</tt>, the data will be stored under <tt>/var/lib/safekeep/mybox/</tt>. Please refer to <tt>safekeep.backup(5)</tt> for more information on this matter.</p> -<p>Once you have determined where the data will be stored (we’ll continue +<p>Once you have determined where the data will be stored (we'll continue the example above), all you have to do is run <tt>rdiff-backup</tt>:</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre> # rdiff-backup -r 1s /var/lib/safekeep/mybox my-restore-dir</pre> -</td></tr></table> +<div class="listingblock"> +<div class="content"> +<pre><tt> # rdiff-backup -r 1s /var/lib/safekeep/mybox my-restore-dir</tt></pre> +</div></div> <p>You will be able to find more information on the restore procedure in the <tt>rdiff-backup(1)</tt> man page.</p> -<h2><a name="_file_selection"></a>FILE SELECTION</h2> +</div> +<h2>FILE SELECTION</h2> +<div class="sectionbody"> <p>It is important to note that the <tt>include</tt>/<tt>exclude</tt> directives that control file selection are matched in the order they appear in the configuration file, and the first one that matches dictates whether the file will be included or excluded. As a result, you have to add the more specific ones first, or the more generic specifications will always win. For example:</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre>... +<div class="listingblock"> +<div class="content"> +<pre><tt>... <include path="/home"/> <exclude path="/home/joe"/> -...</pre> -</td></tr></table> +...</tt></pre> +</div></div> <p>will NOT do what you expect, because the <tt>/home</tt> will match before <tt>/home/joe</tt>, and thus all files under <tt>/home</tt> will be included. The correct way is to flip the two around</p> -<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td> -<pre>... +<div class="listingblock"> +<div class="content"> +<pre><tt>... <exclude path="/home/joe"/> <include path="/home"/> -...</pre> -</td></tr></table> +...</tt></pre> +</div></div> <p>Please see safekeep.backup(5) for more information on file selection.</p> -<h2><a name="_see_also"></a>SEE ALSO</h2> +</div> +<h2>SEE ALSO</h2> +<div class="sectionbody"> <p>rdiff-backup(1), safekeep.conf(5), safekeep.backup(5)</p> -<h2><a name="_author"></a>AUTHOR</h2> -<p>Written by Dimi Paun <<a href="mailto:di...@la...">di...@la...</a>> and Stelian Pop <<a href="mailto:st...@la...">st...@la...</a>>.</p> -<p></p> -<p></p> -<hr><p><small> -Last updated 2009-05-21 11:18:36 EDT -</small></p> +</div> +<h2>AUTHOR</h2> +<div class="sectionbody"> +<p>Written by Dimi Paun <di...@la...> and Stelian Pop <st...@la...>.</p> +</div> +<div id="footer"> +<div id="footer-text"> +Last updated 07-Oct-2008 16:17:26 EDT +</div> +</div> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-23 04:13:11
|
Revision: 725 http://safekeep.svn.sourceforge.net/safekeep/?rev=725&view=rev Author: dimi Date: 2010-11-23 04:13:03 +0000 (Tue, 23 Nov 2010) Log Message: ----------- Tag safekeep 1.3.1 Added Paths: ----------- safekeep/tags/Release-safekeep-1_3_1/ safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE safekeep/tags/Release-safekeep-1_3_1/Makefile safekeep/tags/Release-safekeep-1_3_1/safekeep safekeep/tags/Release-safekeep-1_3_1/safekeep.spec.in Removed Paths: ------------- safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE safekeep/tags/Release-safekeep-1_3_1/Makefile safekeep/tags/Release-safekeep-1_3_1/safekeep safekeep/tags/Release-safekeep-1_3_1/safekeep.spec.in Deleted: safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE =================================================================== --- safekeep/trunk/ANNOUNCE 2010-11-22 04:32:48 UTC (rev 713) +++ safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE 2010-11-23 04:13:03 UTC (rev 725) @@ -1,41 +0,0 @@ -This is release 1.3.0 of SafeKeep, a centralized and easy to use -backup application that combines the best features of a mirror -and an incremental backup. - -What's new in this release: - - Add ionice(1) support for limiting IO on server side. - - Allow control of nice value on both server and client - - Fix password handling when dumping MySQL databases. - - Fix MySQL dumps when passing a username (for newer versions). - - Handle correctly Unicode strings, such as localized DB names. - - Fix a bug when dumping a specific Postgresql database. - - Prepare the code for newer Python versions - - Try to remove a snapshot up to 10 times in a row to workaround - silly udev bug: https://bugzilla.redhat.com/show_bug.cgi?id=577798 - - Multiple internal cleanups, and minor bugs fixes. - -Thanks go to Frank Crawford and Bertrand Lecervoisier for providing -patches and reports for the problems addressed in this release. - -Sources and binaries are available from the following locations: - - - RedHat EL/CentOS 3,4,5,6 Fedora 8,9,10,11,12,13,14: - http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.3.0-1.noarch.rpm - http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.0-1.noarch.rpm - http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.0-1.noarch.rpm - - - Ubuntu Edgy, Dapper, Breezy, Hardy, Karmic, Lucid, Maverick, and Natty: - http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.0_all.deb - http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.0_all.deb - http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.0_all.deb - - - Source: - http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.0.tar.gz - http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.0-1.src.rpm - -To find out more about the project visit on our website: - http://safekeep.sourceforge.net - --- -Dimi Paun <di...@la...> -Lattica, Inc. Copied: safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE (from rev 723, safekeep/trunk/ANNOUNCE) =================================================================== --- safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE (rev 0) +++ safekeep/tags/Release-safekeep-1_3_1/ANNOUNCE 2010-11-23 04:13:03 UTC (rev 725) @@ -0,0 +1,30 @@ +This is release 1.3.1 of SafeKeep, a centralized and easy to use +backup application that combines the best features of a mirror +and an incremental backup. + +What's new in this release: + - Fix a few serios errors preventing safekeep from running. + - Better reporting of client messages and exceptions. + +Sources and binaries are available from the following locations: + + - RedHat EL/CentOS 3,4,5,6 Fedora 8,9,10,11,12,13,14: + http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.3.1-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.1-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.1-1.noarch.rpm + + - Ubuntu Edgy, Dapper, Breezy, Hardy, Karmic, Lucid, Maverick, and Natty: + http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.1_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.1_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.1_all.deb + + - Source: + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.1.tar.gz + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.1-1.src.rpm + +To find out more about the project visit on our website: + http://safekeep.sourceforge.net + +-- +Dimi Paun <di...@la...> +Lattica, Inc. Deleted: safekeep/tags/Release-safekeep-1_3_1/Makefile =================================================================== --- safekeep/trunk/Makefile 2010-11-22 04:32:48 UTC (rev 713) +++ safekeep/tags/Release-safekeep-1_3_1/Makefile 2010-11-23 04:13:03 UTC (rev 725) @@ -1,170 +0,0 @@ -name := safekeep -timestamp := $(shell LANG=C date) -timestamp_svn := $(shell date -u -d '$(timestamp)' '+%Y%m%dT%H%MZ') -version_num := $(shell grep 'VERSION *=' safekeep | sed s'/[^"]*"\([^"].*\)".*/\1/') -version_ts := $(shell date -u -d '$(timestamp)' '+%Y%m%d%H%M') -version := $(version_num) -release := 1 -releasename := $(name)-$(version) -snapshotname:= $(name)-$(version).$(version_ts) -tagname := $(shell echo Release-$(releasename) | tr . _) -dirname := $(shell basename $(PWD)) -rpmroot := $(shell grep '%_topdir' ~/.rpmmacros 2>/dev/null | sed 's/^[^ \t]*[ \t]*//') -svnroot := $(shell LANG=C svn info 2>/dev/null | grep Root | cut -c 18-) -sf_login := dimi,$(name)@frs.sourceforge.net -sf_dir := /home/frs/project/s/sa/$(name) -releasedir := releases -repo_srv := root@ulysses -repo_dir := /var/www/repos/lattica -webroot := ../../website/trunk/WebContent/ -MAN_TXT := doc/safekeep.txt doc/safekeep.conf.txt doc/safekeep.backup.txt -DOC_MAN := doc/safekeep.1 doc/safekeep.conf.5 doc/safekeep.backup.5 -DOC_HTML := $(patsubst %.txt,%.html,$(MAN_TXT)) - - -all: help - -help: - @echo "Targets:" - @echo " help Displays this message" - @echo " info Displays package information (version, etc.)" - @echo " install Installs safekeep and the online documentation" - @echo " docs Builds all documentation formats" - @echo " web Updates the website to the latest documentation" - @echo " build Builds everything needed for an installation" - @echo " tar Builds snapshot source distribution" - @echo " deb Builds snapshot binary and source DEBs" - @echo " rpm Buidls snapshot binary and source RPMs" - @echo " tag Tags the source for release" - @echo " dist Builds release source distribution" - @echo " distdeb Builds release binary and source DEBs" - @echo " distrpm Buidls release binary and source RPMs" - @echo " deploy Deployes the release RPMs to Lattica's repos" - @echo " check Invokes a quick local test for SafeKeep" - @echo " test Invokes a comprehensive remote test for SafeKeep" - @echo " clean Cleans up the source tree" - -info: - @echo "Release Name = $(releasename)" - @echo "Snapshot Name = $(snapshotname)" - @echo "Version = $(version)" - @echo "Timestamp = $(timestamp)" - @echo "Tag = $(tagname)" - @echo "RPM Root = $(rpmroot)" - @echo "SVN Root = $(svnroot)" - - -build: docs - -release: check-info commit-release dist distrpm - -deploy: deploy-lattica deploy-sf - -commit-release: - svn ci -m "Release $(version) (tagged as $(tagname))" - -tag: - svn cp -m "Tag safekeep $(version)" . $(svnroot)/safekeep/tags/$(tagname) - -check-info: info - @echo -n 'Is this information correct? (yes/No) ' - @read x; if [ "$$x" != "yes" ]; then exit 1; fi - -web: html - cp doc/*.html $(webroot) - cd $(webroot); svn ci -m "Update man pages on website to latest as of $(timestamp)" - -docs: html man - -html: $(DOC_HTML) - -man: $(DOC_MAN) - -%.html: %.txt - asciidoc --unsafe -b html4 -d manpage -f doc/asciidoc.conf $< - -%.1 %.5: %.xml - xmlto -o doc -m doc/callouts.xsl man $< - -%.xml: %.txt - asciidoc --unsafe -b docbook -d manpage -f doc/asciidoc.conf $< - -$(DOC_HTML) $(DOC_MAN): doc/asciidoc.conf - -changelog: - svn log -v --xml | svn2log.py -D 0 -u doc/users - -install: - install -m 755 safekeep "/usr/bin/" - install -d -m 755 "/etc/safekeep/backup.d/" - install -m 755 safekeep.conf "/etc/safekeep/" - install -m 755 doc/safekeep.1 "/usr/share/man/man1/" - install -m 755 doc/safekeep.conf.5 "/usr/share/man/man5/" - install -m 755 doc/safekeep.backup.5 "/usr/share/man/man5/" - -tar: - svn export -r {'$(timestamp_svn)'} $(svnroot)/safekeep/trunk $(snapshotname) - cat $(snapshotname)/$(name).spec.in | sed 's/^%define version.*/%define version $(version).$(version_ts)/' > $(snapshotname)/$(name).spec - cat $(snapshotname)/debian/changelog.in | sed 's/^safekeep.*/safekeep ($(version).$(version_ts)) unstable; urgency=low/' > $(snapshotname)/debian/changelog - tar cz -f $(snapshotname).tar.gz $(snapshotname) - rm -rf $(snapshotname) - -deb: tar - tar xz -C /tmp -f $(snapshotname).tar.gz - rm -rf $(snapshotname).tar.gz - cd /tmp/$(snapshotname) && debuild --check-dirname-regex 'safekeep(-.*)?' - -rpm: tar - rpmbuild -ta $(snapshotname).tar.gz - mv $(rpmroot)/SRPMS/$(snapshotname)-$(release)*.src.rpm . - mv $(rpmroot)/RPMS/noarch/$(name)-*-$(version).$(version_ts)-$(release)*.noarch.rpm . - -dist: - svn export $(svnroot)/safekeep/tags/$(tagname) $(releasename) - cat $(releasename)/$(name).spec.in | sed 's/^%define version.*/%define version $(version)/' > $(releasename)/$(name).spec - cat $(releasename)/debian/changelog.in | sed 's/^safekeep.*/safekeep ($(version)) unstable; urgency=low/' > $(releasename)/debian/changelog - mkdir -p $(releasedir); tar cz -f $(releasedir)/$(releasename).tar.gz $(releasename) - cd $(releasename); make docs - rm -rf $(releasename) - -distdeb: dist - tar xz -C /tmp -f $(releasedir)/$(releasename).tar.gz - rm -rf $(releasedir)/$(releasename).tar.gz - cd /tmp/$(releasename) && debuild --check-dirname-regex 'safekeep(-.*)?' - mv /tmp/$(name)-*_$(version)_all.deb $(releasedir) - -distrpm: dist - rpmbuild -ta $(releasedir)/$(releasename).tar.gz - mv $(rpmroot)/SRPMS/$(releasename)-$(release)*.src.rpm $(releasedir) - mv $(rpmroot)/RPMS/noarch/$(name)-*-$(version)-$(release)*.noarch.rpm $(releasedir) - rpm --addsign $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm - -deploy-src-to-sf: - echo -e "cd $(sf_dir)\nmkdir $(version)" | sftp -b- $(sf_login) - scp $(releasedir)/$(releasename).tar.gz $(sf_login):$(sf_dir)/$(version) - scp ANNOUNCE $(sf_login):$(sf_dir)/$(version)/README.txt - -deploy-rpms-to-sf: - scp $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm $(sf_login):$(sf_dir)/$(version) - -deploy-debs-to-sf: - scp $(releasedir)/$(name)-*_$(version)_all.deb $(sf_login):$(sf_dir)/$(version) - -deploy-lattica: - scp $(releasedir)/${name}{,-common,-client,-server}-${version}-*.rpm ${repo_srv}:${repo_dir}/upload - ssh ${repo_srv} "cd ${repo_dir}; ./deploy-rpms.sh upload/${name}-*${version}-*.rpm" - -deploy-sf: - scp releases/${name}{-${version}.tar.gz,{,-common,-client,-server}-${version}-*.rpm} frs.sourceforge.net:uploads - -check: - safekeep-test --local - -test: - safekeep-test --remote - -clean: - rm -f {.,doc,debian}/*~ *.py[co] - rm -f $(name).spec debian/changelog - rm -f doc/*.xml doc/*.html doc/*.[15] - rm -f safekeep-*[.]20[01][0-9][01][0-9][0-3][0-9][012][0-9][0-5][0-9]* Copied: safekeep/tags/Release-safekeep-1_3_1/Makefile (from rev 719, safekeep/trunk/Makefile) =================================================================== --- safekeep/tags/Release-safekeep-1_3_1/Makefile (rev 0) +++ safekeep/tags/Release-safekeep-1_3_1/Makefile 2010-11-23 04:13:03 UTC (rev 725) @@ -0,0 +1,191 @@ +name := safekeep +timestamp := $(shell LANG=C date) +timestamp_svn := $(shell date -u -d '$(timestamp)' '+%Y%m%dT%H%MZ') +version_num := $(shell grep 'VERSION *=' safekeep | sed s'/[^"]*"\([^"].*\)".*/\1/') +version_ts := $(shell date -u -d '$(timestamp)' '+%Y%m%d%H%M') +version := $(version_num) +release := 1 +releasename := $(name)-$(version) +snapshotname:= $(name)-$(version).$(version_ts) +tagname := $(shell echo Release-$(releasename) | tr . _) +dirname := $(shell basename $(PWD)) +rpmroot := $(shell grep '%_topdir' ~/.rpmmacros 2>/dev/null | sed 's/^[^ \t]*[ \t]*//') +svnroot := $(shell LANG=C svn info 2>/dev/null | grep Root | cut -c 18-) +deb_box := 192.168.3.202 +rpm_box := 192.168.3.242 +sf_login := dimi,$(name)@frs.sourceforge.net +sf_dir := /home/frs/project/s/sa/$(name)/$(name) +releasedir := releases +repo_srv := root@ulysses +repo_dir := /var/www/repos/lattica +webroot := ../../website/trunk/WebContent/ +MAN_TXT := doc/safekeep.txt doc/safekeep.conf.txt doc/safekeep.backup.txt +DOC_MAN := doc/safekeep.1 doc/safekeep.conf.5 doc/safekeep.backup.5 +DOC_HTML := $(patsubst %.txt,%.html,$(MAN_TXT)) + + +all: help + +help: + @echo "Targets:" + @echo " help Displays this message" + @echo " info Displays package information (version, etc.)" + @echo " install Installs safekeep and the online documentation" + @echo " docs Builds all documentation formats" + @echo " web Updates the website to the latest documentation" + @echo " build Builds everything needed for an installation" + @echo " tar Builds snapshot source distribution" + @echo " deb Builds snapshot binary and source DEBs" + @echo " rpm Buidls snapshot binary and source RPMs" + @echo " tag Tags the source for release" + @echo " dist Builds release source distribution" + @echo " distdeb Builds release binary and source DEBs" + @echo " distrpm Buidls release binary and source RPMs" + @echo " deploy Deployes the release RPMs to Lattica's repos" + @echo " check Invokes a quick local test for SafeKeep" + @echo " test Invokes a comprehensive remote test for SafeKeep" + @echo " clean Cleans up the source tree" + +info: + @echo "Release Name = $(releasename)" + @echo "Snapshot Name = $(snapshotname)" + @echo "Version = $(version)" + @echo "Timestamp = $(timestamp)" + @echo "Tag = $(tagname)" + @echo "RPM Root = $(rpmroot)" + @echo "SVN Root = $(svnroot)" + + +build: docs + +release: check-info commit-release dist distrpm + +deploy: deploy-lattica deploy-sf + +commit-release: + svn ci -m "Release $(version) (tagged as $(tagname))" + +tag: + svn cp -m "Tag safekeep $(version)" . $(svnroot)/safekeep/tags/$(tagname) + +check-info: info + @echo -n 'Is this information correct? (yes/No) ' + @read x; if [ "$$x" != "yes" ]; then exit 1; fi + +web: html + cp doc/*.html $(webroot) + cd $(webroot); svn ci -m "Update man pages on website to latest as of $(timestamp)" + +docs: html man + +html: $(DOC_HTML) + +man: $(DOC_MAN) + +%.html: %.txt + asciidoc --unsafe -b html4 -d manpage -f doc/asciidoc.conf $< + +%.1 %.5: %.xml + xmlto -o doc -m doc/callouts.xsl man $< + +%.xml: %.txt + asciidoc --unsafe -b docbook -d manpage -f doc/asciidoc.conf $< + +$(DOC_HTML) $(DOC_MAN): doc/asciidoc.conf + +changelog: + svn log -v --xml | svn2log.py -D 0 -u doc/users + +install: + install -m 755 safekeep "/usr/bin/" + install -d -m 755 "/etc/safekeep/backup.d/" + install -m 755 safekeep.conf "/etc/safekeep/" + install -m 755 doc/safekeep.1 "/usr/share/man/man1/" + install -m 755 doc/safekeep.conf.5 "/usr/share/man/man5/" + install -m 755 doc/safekeep.backup.5 "/usr/share/man/man5/" + +tar: + svn export -r {'$(timestamp_svn)'} $(svnroot)/safekeep/trunk $(snapshotname) + cat $(snapshotname)/$(name).spec.in | sed 's/^%define version.*/%define version $(version).$(version_ts)/' > $(snapshotname)/$(name).spec + cat $(snapshotname)/debian/changelog.in | sed 's/^safekeep.*/safekeep ($(version).$(version_ts)) unstable; urgency=low/' > $(snapshotname)/debian/changelog + tar cz -f $(snapshotname).tar.gz $(snapshotname) + rm -rf $(snapshotname) + +deb: tar + tar xz -C /tmp -f $(snapshotname).tar.gz + rm -rf $(snapshotname).tar.gz + cd /tmp/$(snapshotname) && debuild --check-dirname-regex 'safekeep(-.*)?' + +rpm: tar + rpmbuild -ta $(snapshotname).tar.gz + mv $(rpmroot)/SRPMS/$(snapshotname)-$(release)*.src.rpm . + mv $(rpmroot)/RPMS/noarch/$(name)-*-$(version).$(version_ts)-$(release)*.noarch.rpm . + +dist: $(releasedir)/$(releasename).tar.gz + +$(releasedir)/$(releasename).tar.gz: + svn export $(svnroot)/safekeep/tags/$(tagname) $(releasename) + cat $(releasename)/$(name).spec.in | sed 's/^%define version.*/%define version $(version)/' > $(releasename)/$(name).spec + cat $(releasename)/debian/changelog.in | sed 's/^safekeep.*/safekeep ($(version)) unstable; urgency=low/' > $(releasename)/debian/changelog + mkdir -p $(releasedir); tar cz -f $(releasedir)/$(releasename).tar.gz $(releasename) + cd $(releasename); make docs + rm -rf $(releasename) + +distdeb: distdeb-build distdeb-sign + +distdeb-build: $(releasedir)/$(releasename).tar.gz + tar xz -C /tmp -f $< + cd /tmp/$(releasename) && dpkg-buildpackage -us -uc + mv /tmp/$(name)-*_$(version)_all.deb $(releasedir) + +distdeb-sign: + debsign $(releasedir)/$(name)-*_$(version)_all.deb + +distrpm: distrpm-build distrpm-sign + +distrpm-build: $(releasedir)/$(releasename).tar.gz + rpmbuild -ta $< + mv $(rpmroot)/SRPMS/$(releasename)-$(release)*.src.rpm $(releasedir) + mv $(rpmroot)/RPMS/noarch/$(name)-*-$(version)-$(release)*.noarch.rpm $(releasedir) + +distrpm-sign: + rpm --addsign $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm + +dist-sign: distrpm-sign distdeb-sign + +dist-all: dist distdeb-remote fetch-debs distrpm-remote fetch-rpms dist-sign + +distdeb-remote: + ssh $(deb_box) 'cd ~/safekeep/safekeep; svn up; cd trunk; make distdeb-build' + +fetch-debs: + scp $(deb_box):~/safekeep/safekeep/trunk/$(releasedir)/$(name)-*_$(version)_all.deb $(releasedir) + +distrpm-remote: + ssh $(rpm_box) 'cd ~/safekeep/safekeep; svn up; cd trunk; make distrpm-build' + +fetch-rpms: + scp $(rpm_box):~/safekeep/safekeep/trunk/$(releasedir)/$(name)-*$(version)-$(release).*.rpm $(releasedir) + +deploy-lattica: + scp $(releasedir)/${name}{,-common,-client,-server}-${version}-*.rpm ${repo_srv}:${repo_dir}/upload + ssh ${repo_srv} "cd ${repo_dir}; ./deploy-rpms.sh upload/${name}-*${version}-*.rpm" + +deploy-sf: + echo -e "cd $(sf_dir)\nmkdir $(version)" | sftp -b- $(sf_login) + scp $(releasedir)/$(releasename).tar.gz $(sf_login):$(sf_dir)/$(version) + scp ANNOUNCE $(sf_login):$(sf_dir)/$(version)/README.txt + scp $(releasedir)/$(releasename)-$(release)*.src.rpm $(releasedir)/$(name)-*-$(version)-$(release)*.noarch.rpm $(sf_login):$(sf_dir)/$(version) + scp $(releasedir)/$(name)-*_$(version)_all.deb $(sf_login):$(sf_dir)/$(version) + +check: + safekeep-test --local + +test: + safekeep-test --remote + +clean: + rm -f {.,doc,debian}/*~ *.py[co] + rm -f $(name).spec debian/changelog + rm -f doc/*.xml doc/*.html doc/*.[15] + rm -f safekeep-*[.]20[01][0-9][01][0-9][0-3][0-9][012][0-9][0-5][0-9]* Deleted: safekeep/tags/Release-safekeep-1_3_1/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-22 04:32:48 UTC (rev 713) +++ safekeep/tags/Release-safekeep-1_3_1/safekeep 2010-11-23 04:13:03 UTC (rev 725) @@ -1,1565 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2006-2010 Lattica, Inc. -# -# SafeKeep 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. -# -# Safekeep 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 Safekeep. If not, see <http://www.gnu.org/licenses/>. - -from __future__ import generators -import getopt, os, os.path, re, sys, fnmatch, stat, types -import commands, tempfile, time, traceback -import getpass, pwd, xml.dom.minidom -import socket, smtplib - -try: - import subprocess - from subprocess import PIPE, STDOUT - use_subprocess = True -except: - PIPE = -1 - STDOUT = -2 - use_subprocess = False - -###################################################################### -# Python 2.2 compatibility -###################################################################### -# There is no guarantee that we'll continue supporting Python 2.2 -# indefinitely, but we make a reasonable effor to do so as long as -# it doesn't result in major complication/ugliness. - -try: - True, False -except NameError: - True, False = 1, 0 - -def enumerate(obj): - i = -1 - for item in obj: - i += 1 - yield i, item - -###################################################################### -# Global settings -###################################################################### - -config_file = '/etc/safekeep/safekeep.conf' -config_ext = '.backup' -trickle_cmd = 'trickle' -logbuf = [] -is_client = False -verbosity_level = 1 -verbosity_ssh = '' -verbosity_trickle = '' -work_user = getpass.getuser() -backup_user = None -home_dir = None -base_dir = None -default_bandwidth = {} -cmd = "<Missing>" - -PROTOCOL = "1.1" -VERSION = "1.3.0" -VEBOSITY_BY_CLASS = {'DBG': 3, 'INFO': 2, 'WARN': 1, 'ERR': 0} - -###################################################################### -# Miscellaneous support functions -###################################################################### - -def send(msg): - print msg.encode('utf-8') - sys.stdout.flush() - -def log(msg, cls=None): - global logbuf - if cls: - if is_client: cls = cls.lower() - msg = '%s: %s' % (cls, msg) - else: - for c in VEBOSITY_BY_CLASS.keys(): - if msg.startswith(c + ': '): - cls = c - break - else: - cls = 'UNK' - - cutoff = VEBOSITY_BY_CLASS.get(cls.upper()) - if cutoff is None: cutoff = 3 - if is_client or verbosity_level >= cutoff: - logbuf.append(msg) - if is_client: - send(msg) - else: - print >> sys.stderr, msg.encode('utf-8') - -def info_file(file, marker=None): - info('# File: ' + file) - errs = 0; - fin = open(file, 'r') - try: - for line in fin.readlines(): - if marker: - if line.startswith(marker): - marker = None - continue - if line.startswith("Errors "): - errs = int(line[6:]) - info(line.rstrip()) - finally: - fin.close() - return errs - -def stacktrace(): - return "\n" + traceback.format_exc() - -def debug(msg): - log(msg, 'DBG') - -def info(msg): - log(msg, 'INFO') - -def warn(msg): - log(msg, 'WARN') - -def error(msg, ex): - extra = "" - if ex: - extra = stacktrace() - log(msg + extra, 'ERR') - -def do_spawn(args, stdin=None, stdout=False): - debug('Run [' + ' '.join(args) + ']') - _shell = isinstance(args, types.StringTypes) - if stdin: - _stdin = PIPE - else: - _stdin = None - if stdout: - _stderr = None - else: - _stderr = STDOUT - - if use_subprocess: - proc = subprocess.Popen(args, bufsize=1, shell=_shell, stdin=_stdin, stdout=PIPE, stderr=_stderr, close_fds=True) - child_in = proc.stdin - child_out = proc.stdout - else: - if _shell: - args = ["/bin/sh", "-c", args] - if _stderr: - (child_in, child_out) = os.popen4(args) - else: - (child_in, child_out) = os.popen3(args) - - if not stdin: - child_in.close() - - if stdin: - child_in.write(stdin) - child_in.close() - - lines=[] - for line in child_out: - if stdout: - lines.append(line) - else: - info(line.rstrip()) - child_out.close() - - if use_subprocess: - return (proc.wait(), ''.join(lines)) - else: - return (0, ''.join(lines)) - - -def _spawn(args, stdin=None, stdout=False): - if isinstance(args, types.StringTypes): - cmd = args.split(None)[0] - else: - cmd = args[0] - - try: - rc, out = do_spawn(args, stdin, stdout) - except OSError, ex: - ret = "OSError: %s" % (ex) - error('%s failed: %s' % (cmd, ret)); - return ret - - if not rc: - ret = None - elif rc > 0: - ret = 'exited with non zero status: %d' % rc - elif rc < 0: - ret = 'killed by signal: %d' % -rc - else: - ret = 'unknown exit status: %d' % rc - if ret: - error('%s failed: %s' % (cmd, ret)); - return (ret, out) - -# this just spawns an external program (optionally through a shell) -# and returns True it it fails, and False if it successed -def spawn(args): - rc, out = _spawn(args) - return rc - -# this spawans an external program (optionally through a shell), -# feeds it any input via stdin, captures the output and returns it. -# if it fails it returns None, otherwise it returns the output -def call(args, stdin=None): - rc, out = _spawn(args, stdin, stdout=True) - if not rc: - return None - return out - -def try_to_run(args): - try: - rc, out = do_spawn(args) - except OSError, ex: - return False - return rc in (0,1) - -def send_notification(email, smtp): - global logbuf - if not logbuf: return - info('Sending email to %s via %s' % (','.join(email), smtp)) - hostname = socket.gethostname() - msg = 'From: SafeKeep@' + hostname + \ - '\r\nTo: ' + ', '.join(email) + \ - '\r\nSubject: SafeKeep results for ' + hostname + \ - '\r\n\r\n' + '\r\n'.join(logbuf) - if smtp: - server = smtplib.SMTP(smtp) - server.sendmail('SafeKeep@' + hostname, email, msg) - server.quit() - else: - cmd = ['/usr/sbin/sendmail', '-t'] - call(cmd, stdin=msg) - -def is_temp_root(dir): - return dir != '/' - -def reroot(root, path): - if root == '/': return path - if root.endswith('/'): root = root[:-1] - if not path: return root - if path.startswith('/'): return root + path - return os.path.join(root, path) - -def parse_prop_file(file): - props = {} - fin = open(file) - lines = fin.readlines() - fin.close() - for line in lines: - line = line.strip() - if len(line) is 0 or line[0] is '#': continue - if '=' in line: - key, value = line.split('=', 1) - props[key.strip()] = value.strip() - else: - props[line] = None - return props - -###################################################################### -# Configuration file parser -###################################################################### - -class ConfigException (Exception): - def __init__(self, value): - self.value = value - def __str__(self): - return repr(self.value) - -def parse_dump(dump_el): - type = dump_el.getAttribute('type') - if not type: - raise ConfigException('You need to specify the database type') - if type not in ('postgres', 'postgresql', 'pgsql', 'mysql'): - raise ConfigException('Invalid database type: %s' % type) - db = dump_el.getAttribute('db') - user = dump_el.getAttribute('user') - dbuser = dump_el.getAttribute('dbuser') - dbpasswd = dump_el.getAttribute('dbpasswd') - opts = (dump_el.getAttribute('options') or '').split() - - file = dump_el.getAttribute('file') - if not file: - raise ConfigException('You need to specify where the database should be dumped') - cleanup = dump_el.getAttribute('cleanup') - return { 'type' : type, 'db' : db, 'user' : user, 'dbuser' : dbuser, 'dbpasswd': dbpasswd, - 'opts' : opts, 'file' : file, 'cleanup' : cleanup } - -def parse_snap(snap_el): - device = snap_el.getAttribute('device') - if not device: - raise ConfigException('Please specify the device to be snapshot') - if device.rfind('/') == -1 or device.endswith('/'): - raise ConfigException('The device name seems incorrect: ' + device) - size = snap_el.getAttribute('size') - if not size: - raise ConfigException('Please specify the size for the snapshot') - return { 'device' : device, 'size' : size } - -def parse_clude(clude_el): - path = clude_el.getAttribute('path') - path = path.replace('*', '\*').replace('?', '\?') - path = path.replace('[', '\[').replace(']', '\]') - glob = clude_el.getAttribute('glob') - regexp = clude_el.getAttribute('regexp') - if not path and not glob and not regexp: - raise ConfigException('Empty ' + clude_el.tagName) - return { 'type' : clude_el.tagName, 'path' : path, 'glob' : glob, 'regexp' : regexp } - -def parse_bandwidth(bw_el): - return { - 'overall': int(bw_el.getAttribute('overall') or 0), - 'download': int(bw_el.getAttribute('download') or 0), - 'upload': int(bw_el.getAttribute('upload') or 0) - } - -def parse_data_attributes(data_el): - return { - 'exclude-devices': (data_el.getAttribute('exclude-devices') or 'false'), - 'exclude-sockets': (data_el.getAttribute('exclude-sockets') or 'false'), - 'exclude-fifos': (data_el.getAttribute('exclude-fifos') or 'false') - } - -def parse_config(backup_el, dflt_id): - if backup_el.tagName != 'backup': - raise ConfigException('Invalid config file, the top level element must be <backup>') - id = backup_el.getAttribute('id') - if not id: id = dflt_id - - host_el = backup_el.getElementsByTagName('host') - if host_el: - host = host_el[0].getAttribute('name') - user = host_el[0].getAttribute('user') - nice = host_el[0].getAttribute('nice') - key_ctrl = host_el[0].getAttribute('key-ctrl') - key_data = host_el[0].getAttribute('key-data') - else: - host = user = nice = key_ctrl = key_data = None - if host and not user: - user = 'root' - if host and not key_ctrl: - key_ctrl = os.path.join('.ssh', 'safekeep-server-ctrl-key') - if host and not key_data: - key_data = os.path.join('.ssh', 'safekeep-server-data-key') - if key_ctrl and not os.path.isabs(key_ctrl): - key_ctrl = os.path.join(home_dir, key_ctrl) - if key_data and not os.path.isabs(key_data): - key_data = os.path.join(home_dir, key_data) - - bw = {} - bw_el = backup_el.getElementsByTagName('bandwidth') - if len(bw_el) == 1: - bw = parse_bandwidth(bw_el[0]) - elif len(bw_el) > 1: - raise ConfigException('Can not have more than one bandwidth element') - - repo_el = backup_el.getElementsByTagName('repo') - dir = None - retention = None - if len(repo_el) == 1: - dir = repo_el[0].getAttribute('path') - retention = repo_el[0].getAttribute('retention') - elif len(repo_el) > 1: - raise ConfigException('Can not have more than one repo element') - if not dir: dir = id - dir = os.path.join(base_dir, dir) - - options_els = backup_el.getElementsByTagName('options') - options = [] - if len(options_els) > 0: - for options_el in options_els[0].childNodes: - if options_el.nodeType != options_el.ELEMENT_NODE: - continue - option = options_el.nodeName - if option == 'special-files': - warn('options element special-files is deprecated, use data attributes instead') - if option in ('special-files', 'rdiff-backup'): - if options_el.hasAttributes(): - for key, value in options_el.attributes.items(): - options.append({ option : { key : value } }) - else: - raise ConfigException('Option "%s" has no value' % option) - else: - raise ConfigException('Unknown option "%s"' % option) - - setup_el = backup_el.getElementsByTagName('setup') - dumps = [] - snaps = [] - script = None - if len(setup_el) > 0: - dump_els = setup_el[0].getElementsByTagName('dump') - for dump_el in dump_els: - dumps.append(parse_dump(dump_el)) - snap_els = setup_el[0].getElementsByTagName('snapshot') - for snap_el in snap_els: - snaps.append(parse_snap(snap_el)) - script_el = setup_el[0].getElementsByTagName('script') - if len(script_el) == 1: - script = script_el[0].getAttribute('path') - elif len(script_el) > 1: - raise ConfigException('Can not have more than one setup script element') - - data_options = {} - data_el = backup_el.getElementsByTagName('data') - - if len(data_el) == 1: - data_options = parse_data_attributes(data_el[0]) - child_els = data_el[0].childNodes - cludes = [] - for child_el in child_els: - if child_el.nodeType != child_el.ELEMENT_NODE: - continue - if child_el.tagName not in ('include', 'exclude'): - continue - cludes.append(parse_clude(child_el)) - cludes.append({ 'type' : 'exclude', 'path' : '', 'glob' : '', 'regexp' : '.*' }) - elif len(data_el) > 1: - raise ConfigException('Can not have more than one data element') - else: - path_xcludes = [ '/dev/', '/media/', '/mnt/', '/net/', '/proc/', '/selinux/', '/sys/', - '/tmp/', '/var/cache', '/var/lock', '/var/run', '/var/tmp', - '/var/named/chroot/dev', '/var/named/chroot/proc', - '/var/named/chroot/var/run', '/var/named/chroot/var/tmp' ] - cludes = [{ 'type' : 'exclude', 'path' : path, 'glob' : None, 'regexp' : None } for path in path_xcludes] - - return { 'id': id, 'host' : host, 'nice' : nice, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, - 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, 'script' : script, - 'cludes' : cludes, 'data_options' : data_options, 'options' : options, 'bw' : bw} - -def parse_locs(cfglocs): - cfgfiles = [] - for cfg in cfglocs: - if os.path.isdir(cfg): - for ent in os.listdir(cfg): - if not ent.endswith(config_ext): - warn('Ignoring file %s not ending in %s' % (os.path.join(cfg, ent), config_ext)) - continue - filepath = os.path.join(cfg, ent) - if not os.path.isfile(filepath): - continue - cfgfiles.append(filepath) - elif os.path.isfile(cfg): - cfgfiles.append(cfg) - else: - warn('Inaccessible configuration, ignoring: %s' % cfg) - - cfgs = {} - for filepath in cfgfiles: - filename = os.path.splitext(os.path.basename(filepath))[0] - - cfg_file = open(filepath) - cfg_str = cfg_file.read().strip() - cfg_file.close() - - dom = xml.dom.minidom.parseString(cfg_str) - try: - cfg = parse_config(dom.documentElement, filename) - finally: - dom.unlink() - cfg['text'] = cfg_str - if cfg['id'] in cfgs: - raise ConfigException('Duplicate client ID: %s' % cfg['id']) - cfgs[cfg['id']] = cfg - - return cfgs - -###################################################################### -# Script, DB and SNAPSHOT support -# setup methods can raise exception to signal errors -# teardown methods must succeed and cleanup the state -###################################################################### - -def check_script_permissions(script): - if not os.path.isfile(script): - return '%s is not a regular file' % script - if not os.access(script, os.X_OK): - return '%s is not executable' % script - - statinfo = os.stat(script) - if statinfo.st_uid and statinfo.st_uid != os.getuid(): - return '%s is owned by others' % script - - if (statinfo.st_mode & (stat.S_IWGRP | stat.S_IWOTH)): - return '%s is writable by others' % script - - return None - -def client_side_script(step, cfg, bdir): - debug('Do client_side_script: step %s' % step) - - ret = None - script = cfg['script'] - - if script: - debug('client_side_script: script = %s' % script) - if os.path.exists(script): - ret = check_script_permissions(script) - if not ret: - ret = spawn([script, step, cfg['id'], bdir]) - else: - debug('client_side_script: %s not found' % script) - - return ret - -def do_client_dbdump(cfg): - debug('Doing DB dumps') - for dump in cfg['dumps']: - type = dump['type'] - opts = dump['opts'] - passwdfile = None - if type in ('postgres', 'postgresql', 'pgsql'): - if dump['db']: - args = ['pg_dump'] - args.extend(['-C']) - else: - args = ['pg_dumpall'] - if dump['dbuser']: - args.extend(['-U', dump['dbuser']]) - args.extend(opts) - if dump['db']: - args.extend([dump['db']]) - if dump['dbpasswd']: - (fd, passwdfile) = tempfile.mkstemp() - f = os.fdopen(fd, 'w') - f.write(dump['dbpasswd']) - f.close() - - elif type in ('mysql'): - args = ['mysqldump'] - if dump['dbuser']: - args.extend(['-u', dump['dbuser']]) - if dump['dbpasswd']: - args.extend(['-p%s' % dump['dbpasswd']]) - if not dump['db']: - args.extend(['-A']) - args.extend(opts) - if dump['db']: - args.extend([dump['db']]) - - else: - warn('Invalid database type: ' + type) - continue - - if dump['user']: - cmd = ' '.join([commands.mkarg(arg) for arg in args]) - args = [ 'su', '-c', cmd, '-', dump['user'] ] - cmd = ' '.join([commands.mkarg(arg) for arg in args]) - cmd = '%s > %s' % (cmd, commands.mkarg(dump['file'])) - - - if passwdfile: - os.environ['PGPASSFILE'] = passwdfile - try: - ec = spawn(cmd) - finally: - if passwdfile: - del os.environ['PGPASSFILE'] - os.remove(passwdfile) - if ec: - warn('Can not dump the database: %s' % dump['db']) - -def do_client_dbdump_teardown(cfg): - debug('Tear down DB dumps') - for dump in cfg['dumps']: - if dump['cleanup'].lower() != 'true': - continue - try: - os.remove(dump['file']) - except Exception, e: - warn('Unable to remove dump file: %s for database %s because: %s' % - (dump['file'], dump['db'], e)) - -def lvm_snap_information(): - lines = call(['lvs', '--separator', ':', '--noheadings']) or '' - lvms = [] - for line in lines: - if line.count(':') > 3: - (volume, group, attr, blah1) = line.lstrip().split(':', 3) - if fnmatch.fnmatch(volume, '*_snap_safekeep-*') and attr[0].lower() == 's': - lvms.append([volume, group]) - return lvms - -def mount_information(reverse = False): - lines = call(['mount']) or '' - mounts = [] - pattern = re.compile(r"^(\S+) on (.+) type (\S+) \((\S+)\)") - if reverse: - lines.reverse() - for line in lines: - matches = pattern.match(line) - if not matches is None: - mounts.append(matches.groups()) - return mounts - -def map_lvm_device(device): - device = device.replace('/mapper','').replace('-','/').replace('//', '-') - return device.split('/')[-2:] - -def check_lvm_information(device): - (group, volume) = map_lvm_device(device) - for (lvm_volume, lvm_group) in lvm_snap_information(): - if lvm_group == group and lvm_volume.startswith(volume): - return True - return False - -def gather_lvm_information(device): - (group, volume) = map_lvm_device(device) - for (device, mountpoint, mounttype, mountoptions) in mount_information(False): - if [group, volume] == map_lvm_device(device): - return (group, volume, mountpoint, mounttype) - return (None, None, None, None) - -def gather_snap_information(device, bdir): - (group, volume, mountpoint, mounttype) = gather_lvm_information(device) - if not mountpoint: return (None, None, None, None) - lvmdev = os.path.join('/dev', group, volume) - if bdir[-1] == '/': bdir = bdir[:-1] - snapname = '%s_snap_%s' % (volume, os.path.basename(bdir)) - snapdev = os.path.join('/dev', group, snapname) - if os.path.isabs(mountpoint[0]): mountpoint = mountpoint[1:] - return (lvmdev, snapdev, os.path.join(bdir, mountpoint), mounttype) - -def do_client_snap(cfg, bdir): - assert is_temp_root(bdir) - debug('Doing FS snapshots') - for snap in cfg['snaps']: - device = snap['device'] - (lvmdev, snapdev, snapmnt, snaptyp) = gather_snap_information(device, bdir) - if not snapmnt: - warn('Cannot find the mountpoint for: %s' % device) - continue - args = ['lvcreate', '--snapshot', '--size', snap['size'], - '--name', os.path.basename(snapdev), lvmdev] - ec = spawn(args) - if ec: - warn('Can not snapshot the device: %s' % device) - continue - # no need to mkdir since the mountpoint already exists - args = ['mount', '-t', snaptyp, snapdev, snapmnt] - ec = spawn(args) - if ec: - warn('Can not mount the snapshot: %s' % device) - ret = spawn(['lvremove', '--force', snapdev]) - if ret: - warn('Can not tear down snapshot: %s' % device) - -def do_client_snap_teardown(cfg, bdir): - assert is_temp_root(bdir) - debug('Tear down FS snapshots dumps') - snaps = list(cfg['snaps']) - snaps.reverse() - for snap in snaps: - device = snap['device'] - (lvmdev, snapdev, snapmnt, snaptyp) = gather_snap_information(device, bdir) - if not snapmnt: - warn('Can not find the mountpoint for: %s' % device) - continue - ret = spawn(['umount', snapmnt]) - if ret: - warn('Can not umount the snapshot: %s' % snapmnt) - - # stupid workaround for https://bugzilla.redhat.com/show_bug.cgi?id=577798 - for i in range(1,10): - ret = spawn(['lvremove', '--force', snapdev]) - if not ret: - break - - if ret: - warn('Can not tear down snapshot: %s' % device) - -###################################################################### -# Client implementation -###################################################################### - -def do_client_config(cmd): - cfgStr = '' - - (cfg_cmd, cnt_str, dflt_id) = cmd.split(':', 2) - for i in xrange(int(cnt_str)): - line = sys.stdin.readline() - if not line: raise ConfigException('Unexpected end of file') - cfgStr += line - - return do_client_config_parse(cfgStr, dflt_id) - -def do_client_config_parse(cfgStr, dflt_id=None): - dom = xml.dom.minidom.parseString(cfgStr) - try: - return parse_config(dom.documentElement, dflt_id) - finally: - dom.unlink() - -def do_client_setup(cfg): - debug('Do setup of %s' % cfg['host']) - - do_client_dbdump(cfg) - - if len(cfg['snaps']) > 0: - debug('Checking FS snapshots') - for snap in cfg['snaps']: - device = snap['device'] - if check_lvm_information(device): - raise Exception("Previous snapshots found for %s: run 'safekeep --server --cleanup' to correct" % device) - - ret = spawn(['modprobe', 'dm-snapshot']) - if ret: - warn('modprobe dm-snapshot failed, continuing') - bdir = tempfile.mkdtemp("-rbind", "safekeep-", "/mnt") - ret = spawn(['mount', '--rbind', '/', bdir]) - if ret: - warn('mount --rbind failed, snapshotting will be disabled') - try: - os.rmdir(bdir) - except Exception, e: - warn('Failed to remove: %s' % bdir) - bdir = '/' - else: - do_client_snap(cfg, bdir) - else: - bdir = '/' - debug('Working root is %s' % bdir) - - return bdir - -def do_client_cleanup(cfg, bdir): - debug('Do cleanup of %s in %s' % (cfg['host'], bdir)) - if is_temp_root(bdir): - do_client_snap_teardown(cfg, bdir) - - ret = spawn(['umount', '-l', bdir]) - if ret: - warn('Failed to unmount: %s' % bdir) - else: - try: - os.rmdir(bdir) - except Exception, e: - warn('Unable to remove: ' + bdir) - - do_client_dbdump_teardown(cfg) - -def do_client_compat(server_versions): - debug('Server versions: %s' % server_versions) - -def do_client_scrub(): - debug("Do client scrub loop") - - if os.getuid(): - if is_client: - raise Exception('client not running as root') - else: - warn('--cleanup should be run as root on client') - info('No cleanup performed') - else: - scrubbed = False - - if os.environ['PATH'][-1] == ':': - os.environ['PATH'] += '/sbin:/usr/sbin:/usr/local/sbin:' - else: - os.environ['PATH'] += ':/sbin:/usr/sbin:/usr/local/sbin' - - # Go through and unmount anythings that are still hanging around - - debug("Cleaning up existing mounts") - for (device, mountpoint, mounttype, mountoptions) in mount_information(True): - if mountpoint.startswith('/mnt/safekeep-'): - info("Removing mount %s" % mountpoint) - if device == '/' and 'bind' in mountoptions.split(','): - info("Removing rbind directory %s" % mountpoint) - ret = spawn(['umount', '-l', mountpoint]) - if ret: - warn('Failed to unmount: %s' % mountpoint) - else: - try: - os.rmdir(mountpoint) - except Exception, e: - warn('Failed to remove: %s' % mountpoint) - else: - ret = spawn(['umount', mountpoint]) - if ret: - warn('Can not unmount the snapshot: %s' % mountpoint) - if fnmatch.fnmatch(device, '*_snap_safekeep-*'): - info("Removing snapshot %s" % device) - ret = spawn(['lvremove', '--force', device]) - if ret: - warn('Can not tear down snapshot: %s' % device) - scrubbed = True - - # Now cleanup any snapshots still hanging around - - debug("Cleaning up remaining snapshots") - for (volume, group) in lvm_snap_information(): - device = os.path.join('/dev', group, volume) - info("Removing snapshot %s" % device) - ret = spawn(['lvremove', '--force', device]) - if ret: - warn('Can not tear down snapshot: %s' % device) - scrubbed = True - - # Now cleanup any safekeep directories still hanging around - - debug("Cleaning up remaining safekeep directories") - if os.path.isdir('/mnt'): - for ent in os.listdir('/mnt'): - mountpoint = os.path.join('/mnt', ent) - if ent.startswith('safekeep-') and os.path.isdir(mountpoint): - info("Removing rbind directory %s" % mountpoint) - try: - os.rmdir(mountpoint) - except Exception, e: - warn('Failed to remove: %s' % mountpoint) - - if not scrubbed: - info('No cleanup required') - -def do_client(): - debug("Do client main loop") - should_cleanup = True - bdir = '/' - cfg = do_client_config_parse('<backup/>', 'def') - ex = None - try: - while True: - try: - line = sys.stdin.readline() - if line.startswith('ALOHA'): - do_client_compat(line.strip().split(':', 1)[1]) - send('OK %s, %s' % (PROTOCOL, VERSION)) - elif line.startswith('CONFIG'): - cfg = do_client_config(line) - ret = client_side_script('STARTUP', cfg, bdir) - if ret: - send('ERROR Client-side setup script failed: %s' % ret) - else: - send('OK') - elif line.startswith('SETUP'): - client_side_script('PRE-SETUP', cfg, bdir) - bdir = do_client_setup(cfg) - client_side_script('POST-SETUP', cfg, bdir) - send('OK ' + bdir) - elif line.startswith('CLEANUP'): - dir = line[7:].strip() - if dir == bdir: should_cleanup = False - do_client_cleanup(cfg, dir) - client_side_script('POST-BACKUP', cfg, bdir) - send('OK') - elif line.startswith('SCRUB'): - do_client_scrub() - client_side_script('POST-SCRUB', cfg, bdir) - send('OK') - elif not line: - break - else: - send('ERROR Unknown command: %s' % line) - break - except Exception, e: - ex = e - break - finally: - if should_cleanup: - do_client_cleanup(cfg, bdir) - - if ex: - send('TRACEBACK ' + ex + '>>>' + stacktrace().replace('\n', '###')) - -###################################################################### -# Server implementation -###################################################################### - -def do_server_getanswer(cout): - while True: - line = cout.readline() - if line.startswith('OK'): - return line[2:-1].strip() - elif line.startswith('ERROR'): - raise Exception(line[5:].strip()) - elif line.startswith('TRACEBACK'): - i = line.find('>>>') - error(line[i+3:].replace('###', '\n')) - raise Exception(line[10:i].strip()) - elif not line: - raise Exception('client died unexpectedly') - else: - log(line[:-1]) - -def do_server_rdiff(cfg, bdir, nice, ionice, force): - args = [] - - if nice: - args.extend(['nice', '-n' + str(nice)]) - - ionice_cmd = 'ionice' - if ionice and ionice != 'none': - if try_to_run(ionice_cmd): - if ionice is 'idle': - args.extend([ionice_cmd, '-c3', '-t']) - else: - args.extend([ionice_cmd, '-c2', '-n' + ionice, '-t']) - else: - warn('ionice(1) not available, ignoring ionice.adjustment') - - args.extend(['rdiff-backup']) - - if cfg['host']: - trickle = '' - - def get_bw(vals, dir): - return vals.get(dir) or vals.get('overall') - - def get_bandwidth(cfg, dir): - return get_bw(cfg['bw'], dir) or get_bw(default_bandwidth, dir) - - limit_dl = get_bandwidth(cfg, 'download') - limit_ul = get_bandwidth(cfg, 'upload') - if limit_dl or limit_ul: - trickle = trickle_cmd + ' ' + verbosity_trickle - if limit_dl: - trickle += ' -d ' + str(limit_dl) - if limit_ul: - trickle += ' -u ' + str(limit_ul) - - if trickle: - if not try_to_run(trickle_cmd + ' -V'): - warn('Trickle not available, bandwidth limiting disabled') - trickle = '' - - schema = '%s ssh %s -i %s %%s rdiff-backup --server' % (trickle, verbosity_ssh, cfg['key_data']) - args.extend(['--remote-schema', schema]) - - if force: - args.extend(['--force']) - - options_append = [] - - special_files = [] - if cfg['data_options'].get('exclude-devices').lower() == 'true': - special_files.extend(['--exclude-device-files']) - if cfg['data_options'].get('exclude-sockets').lower() == 'true': - special_files.extend(['--exclude-sockets']) - if cfg['data_options'].get('exclude-fifos').lower() == 'true': - special_files.extend(['--exclude-fifos']) - - for option in cfg['options']: - if 'special-files' in option: - if 'include' in option['special-files']: - if 'true' == option['special-files']['include'].lower(): - special_files = ['--include-special-files'] - - # Note if we ever add other backends this section should only be run - # when rback-diff is the current option. - - if 'rdiff-backup' in option: - if 'append' in option['rdiff-backup']: - options_append.extend(option['rdiff-backup']['append'].split(None)) - - args.extend(special_files) - args.extend(options_append) - - for clude in cfg['cludes']: - opt = '--' + clude['type'] - if clude['path']: - args.extend([opt, reroot(bdir, clude['path'])]) - if clude['glob']: - args.extend([opt, reroot(bdir, clude['glob'])]) - if clude['regexp']: - args.extend([opt + '-regexp', bdir + clude['regexp']]) - - userhost = '' - if cfg['host']: - userhost = '%s@%s' % (cfg['user'], cfg['host']) - args.extend([userhost + '::' + bdir, cfg['dir']]) - ret = spawn(args) - if ret: - raise Exception('Failed to run rdiff-backup') - -def do_server_rdiff_cleanup(cfg): - args = ['rdiff-backup', '--check-destination-dir', cfg['dir']] - ret = spawn(args) - if ret: - warn('Failed to cleanup old data, please fix the problem manually') - -def do_server_data_cleanup(cfg): - args = ['rdiff-backup', '--force', '--remove-older-than', cfg['retention'], cfg['dir']] - ret = spawn(args) - if ret: - warn('Failed to cleanup old data, please fix the problem manually') - -def do_server_compat(client_versions): - (client_protocol, client_version) = client_versions.split(',') - (client_major, client_minor) = client_protocol.strip().split('.') - (server_major, server_minor) = PROTOCOL.split('.') - if server_major != client_major: - raise Exception('Incompatible protocols: %s <> %s' % (PROTOCOL, client_protocol)) - elif server_minor > client_minor: - warn('Protocol mismatch: %s <> %s' % (PROTOCOL, client_protocol)) - -def do_server(cfgs, ids, nice, ionice, force, cleanup): - debug("Do server main loop") - for cfg in cfgs.itervalues(): - id = cfg['id'] - if ids and id not in ids: continue - info('------------------------------------------------------------------') - info('Server backup starting for client %s' % id) - - cleaned_up = 0 - try: - if cfg['host']: - if not os.path.isfile(cfg['key_ctrl']): - raise Exception('Client %(id)s missing ctrl key %(key_ctrl)s' % cfg) - if not os.path.isfile(cfg['key_data']): - raise Exception('Client %(id)s missing data key %(id)s' % cfg) - - datadir = os.path.join(os.getcwd(), cfg['dir']) - if not os.path.isdir(datadir): - try: - os.makedirs(datadir) - except EnvironmentError, ex: - raise Exception('Can not create data store dir: %s' % datadir) - - rdiff_logdir = os.path.join(datadir, 'rdiff-backup-data') - if cfg['retention'] and os.path.isdir(rdiff_logdir) and not cleanup: - do_server_data_cleanup(cfg) - - cmd = [] - if cfg['host']: - cmd.extend(['ssh', verbosity_ssh, '-T', '-i', cfg['key_ctrl'], '-l', cfg['user'], cfg['host']]) - cmd.extend(['safekeep', '--client']) - - (cin,cout) = os.popen2(cmd) - - cin.write('ALOHA: %s, %s\n' % (PROTOCOL, VERSION)) - cin.flush() - client_versions = do_server_getanswer(cout) - do_server_compat(client_versions) - - cin.write('CONFIG: %d: %s\n' % (len(cfg['text'].splitlines()), id)) - cin.write(cfg['text'] + '\n') - cin.flush() - do_server_getanswer(cout) - if cleanup: - cin.write('SCRUB\n') - cin.flush() - do_server_getanswer(cout) - bdir = '/' # Fake directory for the rest of the cleanup - do_server_rdiff_cleanup(cfg) - cleaned_up = 1 - errs = 0 - else: - cin.write('SETUP\n') - cin.flush() - bdir = do_server_getanswer(cout) - - if os.path.isdir(rdiff_logdir): - rdiff_logpre = os.listdir(rdiff_logdir) - else: - rdiff_logpre = [] - - backup_log = os.path.join(rdiff_logdir, 'backup.log') - if os.path.isfile(backup_log): - backup_marker = '=== Backup session on %s ===' % time.asctime() - fbm = open(backup_log, 'a') - fbm.write(backup_marker + '\n') - fbm.close() - else: - backup_marker = None - - do_server_rdiff(cfg, bdir, nice, ionice, force) - - errs = 0 - if os.path.isdir(rdiff_logdir): - info_file(backup_log, backup_marker) - rdiff_logpost = os.listdir(rdiff_logdir) - for lfn in rdiff_logpost: - if lfn.startswith('session_statistics.') and lfn.endswith('.data') and lfn not in rdiff_logpre: - errs += info_file(os.path.join(rdiff_logdir, lfn)) - else: - warn('Log dir does not exist.') - - cin.write('CLEANUP %s\n' % bdir) - cin.flush() - do_server_getanswer(cout) - - if errs == 0: - info('Server backup for client %s: OK' % id) - else: - info('Server backup for client %s: OK (%d WARNINGS)' % (id, errs)) - - except Exception, ex: - if cleanup and not cleaned_up: - info('Client-side cleanup for client %s: FAILED' % id) - do_server_rdiff_cleanup(cfg) - else: - error('Server backup for client %s: FAILED' % id, ex) - - info('------------------------------------------------------------------') - debug('Server backup done') - -def do_list(cfgs, ids, list_type, list_date, list_parsable): - debug("Do server listing main loop") - for cfg in cfgs.itervalues(): - id = cfg['id'] - if ids and id not in ids: continue - if list_parsable: - info('Client: %s' % id) - else: - info('------------------------------------------------------------------') - info('Server listing for client %s' % id) - - - args = ['rdiff-backup'] - - if list_type is 'increments': - args.extend(['--list-increments']) - elif list_type is 'sizes': - args.extend(['--list-increment-sizes']) - elif list_type is 'changed': - args.extend(['--list-changed-since', list_date]) - elif list_type is 'attime': - args.extend(['--list-at-time', list_date]) - else: - assert False, 'Unknown list type: ' + list_type - - if list_parsable: - args.extend(['--parsable-output']) - - args.extend([cfg['dir']]) - ret... [truncated message content] |
From: <di...@us...> - 2010-11-23 04:12:58
|
Revision: 724 http://safekeep.svn.sourceforge.net/safekeep/?rev=724&view=rev Author: dimi Date: 2010-11-23 04:12:51 +0000 (Tue, 23 Nov 2010) Log Message: ----------- New version Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-23 04:11:04 UTC (rev 723) +++ safekeep/trunk/safekeep 2010-11-23 04:12:51 UTC (rev 724) @@ -68,7 +68,7 @@ cmd = "<Missing>" PROTOCOL = "1.1" -VERSION = "1.3.0" +VERSION = "1.3.1" VEBOSITY_BY_CLASS = {'DBG': 3, 'INFO': 2, 'WARN': 1, 'ERR': 0} ###################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |