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...> - 2007-03-08 21:46:07
|
Revision: 448 http://safekeep.svn.sourceforge.net/safekeep/?rev=448&view=rev Author: dimi Date: 2007-03-08 13:46:05 -0800 (Thu, 08 Mar 2007) Log Message: ----------- Make use of the new config files to avoid the deprecation warning in tests Modified Paths: -------------- safekeep/trunk/safekeep-test Modified: safekeep/trunk/safekeep-test =================================================================== --- safekeep/trunk/safekeep-test 2007-03-08 20:56:12 UTC (rev 447) +++ safekeep/trunk/safekeep-test 2007-03-08 21:46:05 UTC (rev 448) @@ -119,12 +119,17 @@ def localTest(tmproot): params = {'tmproot': tmproot, 'args': safekeep_args} + os.mkdir(os.path.join(tmproot, 'clients.d')) os.mkdir(os.path.join(tmproot, 'client')) os.mkdir(os.path.join(tmproot, 'client', 'data')) os.mkdir(os.path.join(tmproot, 'client', 'home')) os.mkdir(os.path.join(tmproot, 'client', 'misc')) os.mkdir(os.path.join(tmproot, 'server')) CONFIG = """ + # Default values should do for now + """ + writefile(os.path.join(tmproot, 'safekeep.conf'), CONFIG % params) + BACKUP = """ <backup id="%(tmproot)s"> <repo path="%(tmproot)s/server" /> <data> @@ -133,7 +138,7 @@ </data> </backup> """ - writefile(os.path.join(tmproot, 'test.backup'), CONFIG % params) + writefile(os.path.join(tmproot, 'clients.d', 'test.backup'), BACKUP % params) for i in xrange(test_reps): FILES = ( 'data/fileA.out', @@ -149,7 +154,7 @@ cmd = "cd %(tmproot)s/client; find -type f -a \! -name '*.nobackup' | sort | xargs md5sum > %(tmproot)s/md5sums.client" if os.system(cmd % params): raise TestFailure("Can't compute the source MD5 sums") - cmd = "safekeep %(args)s --conf '%(tmproot)s/test.backup'" + cmd = "safekeep %(args)s --conf '%(tmproot)s/safekeep.conf'" if os.system(cmd % params): raise TestFailure("Can't backup files") os.mkdir(os.path.join(tmproot, 'restore')) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-08 20:56:13
|
Revision: 447 http://safekeep.svn.sourceforge.net/safekeep/?rev=447&view=rev Author: dimi Date: 2007-03-08 12:56:12 -0800 (Thu, 08 Mar 2007) Log Message: ----------- Update docs Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2007-03-08 20:53:35 UTC (rev 446) +++ safekeep/trunk/doc/safekeep.backup.txt 2007-03-08 20:56:12 UTC (rev 447) @@ -114,11 +114,10 @@ /backup/repo/@path:: The path under which the backups will be stored. Relative - paths are based on current working directory where `safekeep(1)` - server is run. Typically this working directory will be the home - directory of the user under which `safekeep(1)` runs on the server. - As a result, in a typical installation the data will be stored - under `/var/lib/safekeep/<id>/`. If the directory does not exist, + paths are based on the 'base.dir' setting from the 'safekeep.conf(5)'. + Since the default value for 'base.dir' is the user's home directory, + in a typical installation the data will be stored under + `/var/lib/safekeep/<id>/`. If the directory does not exist, `safekeep(1)` will attempt to create it automatically. The backup will fail altogether if the directory can not be created. Optional, defaults to the client ID, see `/backup/@id`. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-08 20:53:36
|
Revision: 446 http://safekeep.svn.sourceforge.net/safekeep/?rev=446&view=rev Author: dimi Date: 2007-03-08 12:53:35 -0800 (Thu, 08 Mar 2007) Log Message: ----------- Look for the client .backup files in the clients.d directory that is present in the same directory as the safekeep.conf file. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-08 20:35:44 UTC (rev 445) +++ safekeep/trunk/safekeep 2007-03-08 20:53:35 UTC (rev 446) @@ -5,7 +5,7 @@ import getpass, pwd, xml.dom.minidom import socket, smtplib -config_dir = '/etc/safekeep' +config_file = '/etc/safekeep/safekeep.conf' config_ext = '.backup' logbuf = [] is_client = False @@ -872,12 +872,15 @@ usage(2) if mode is not 'client': - if cfgfile is None: - propfile = os.path.join(config_dir, 'safekeep.conf') - if os.path.isfile(propfile): cfgfile = propfile - if cfgfile: + if cfgfile is None and os.path.isfile(config_file): + cfgfile = config_file + if cfgfile and os.path.isfile(cfgfile): props = parse_prop_file(cfgfile) else: + if cfgfile: + warn('Configuration file does not exist, skipping: %s' % cfgfile) + else: + cfgfile = config_file props = {} if 'backup.user' in props: backup_user = props['backup.user'] @@ -888,7 +891,7 @@ if 'email.to' in props: email = props['email.to'].split(',') if len(cfglocs) == 0: - locs = os.path.join(config_dir, 'clients.d') + locs = os.path.join(os.path.dirname(cfgfile), 'clients.d') if os.path.isdir(locs): cfglocs.append(locs) if backup_user and 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...> - 2007-03-08 20:35:46
|
Revision: 445 http://safekeep.svn.sourceforge.net/safekeep/?rev=445&view=rev Author: dimi Date: 2007-03-08 12:35:44 -0800 (Thu, 08 Mar 2007) Log Message: ----------- Add property that controls the data repo base dir Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/sample.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 20:27:15 UTC (rev 444) +++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 20:35:44 UTC (rev 445) @@ -26,6 +26,11 @@ If not specified, `safekeep` will just run under the current user. +base.dir:: + The base directory for date repository relative paths. + If not specified, it defaults to the home directory + of the backup user. + email.to:: In addition to writing the session logs on the standard output, `safekeep` can also send the Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-08 20:27:15 UTC (rev 444) +++ safekeep/trunk/safekeep 2007-03-08 20:35:44 UTC (rev 445) @@ -13,6 +13,7 @@ work_user = getpass.getuser() backup_user = None home_dir = None +base_dir = None PROTOCOL = "1.0" VERSION = "0.9.1" @@ -203,6 +204,7 @@ elif len(repo_el) > 1: raise ConfigException('Can not have more than a repo element') if not dir: dir = id + dir = os.path.join(base_dir, dir) setup_el = backup_el.getElementsByTagName('setup') dumps = [] @@ -800,7 +802,7 @@ except getopt.GetoptError: usage(2) - global backup_user, home_dir + global backup_user, home_dir, base_dir mode = None email = [] smtp = None @@ -879,6 +881,8 @@ props = {} if 'backup.user' in props: backup_user = props['backup.user'] + if 'base.dir' in props: + base_dir = props['base.dir'] if 'email.smtp.server' in props: smtp = props['email.smtp.server'] if 'email.to' in props: @@ -897,6 +901,9 @@ backup_user = work_user home_dir = os.getenv('HOME', '/') + if not base_dir: + base_dir = home_dir + if len(cfglocs) > 0: cfgs = parse_locs(cfglocs) else: Modified: safekeep/trunk/sample.conf =================================================================== --- safekeep/trunk/sample.conf 2007-03-08 20:27:15 UTC (rev 444) +++ safekeep/trunk/sample.conf 2007-03-08 20:35:44 UTC (rev 445) @@ -7,6 +7,9 @@ # the user under which the server will run # backup.user = safekeep +# the base directory for data repository relative paths +# base.dir = /var/lib/safekeep + # a comma separated list of emails to receive the logs # email.to=pe...@co...,ro...@co... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-08 20:27:17
|
Revision: 444 http://safekeep.svn.sourceforge.net/safekeep/?rev=444&view=rev Author: dimi Date: 2007-03-08 12:27:15 -0800 (Thu, 08 Mar 2007) Log Message: ----------- Instrument the --keys mode to work with a different backup user. Rename the property to 'backup.user' instead of just 'user'. Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/sample.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 03:44:20 UTC (rev 443) +++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 20:27:15 UTC (rev 444) @@ -20,6 +20,12 @@ PARAMETERS ---------- + +backup.user:: + The Unix user under which the server will run. + If not specified, `safekeep` will just run under the + current user. + email.to:: In addition to writing the session logs on the standard output, `safekeep` can also send the @@ -34,11 +40,6 @@ If not specified, `safekeep` will just use `/usr/sbin/sendmail` to deliver the mail. -user:: - The Unix user under which the server will run. - If not specified, `safekeep` will just run under the - current user. - FILES ----- /etc/safekeep/safekeep.conf Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-08 03:44:20 UTC (rev 443) +++ safekeep/trunk/safekeep 2007-03-08 20:27:15 UTC (rev 444) @@ -2,7 +2,7 @@ import getopt, os, os.path, popen2, re, sys import commands, tempfile, time, traceback -import xml.dom.minidom +import getpass, pwd, xml.dom.minidom import socket, smtplib config_dir = '/etc/safekeep' @@ -10,6 +10,9 @@ logbuf = [] is_client = False verbosity_level = 1 +work_user = getpass.getuser() +backup_user = None +home_dir = None PROTOCOL = "1.0" VERSION = "0.9.1" @@ -186,11 +189,10 @@ host = user = key_ctrl = key_data = None if host and not user: user = 'root' - home = os.getenv('HOME', '/root') if host and not key_ctrl: - key_ctrl = os.path.join(home, '.ssh', 'safekeep-server-ctrl-key') + key_ctrl = os.path.join(home_dir, '.ssh', 'safekeep-server-ctrl-key') if host and not key_data: - key_data = os.path.join(home, '.ssh', 'safekeep-server-data-key') + key_data = os.path.join(home_dir, '.ssh', 'safekeep-server-data-key') repo_el = backup_el.getElementsByTagName('repo') dir = None @@ -648,8 +650,9 @@ break if deploy: info('%s: Key do not exist, generating it now: %s' % (id, privatekeyfile)) - gencmd = 'ssh-keygen -q -b 1024 -t dsa -N "" -C "SafeKeep auto generated key at %s@%s" -f %s' % \ - (os.getenv('LOGNAME', 'root'), os.uname()[1], privatekeyfile) + gencmd = 'ssh-keygen -q -b 1024 -t dsa -N "" -C "SafeKeep auto generated key at %s@%s" -f %s' % (backup_user, os.uname()[1], privatekeyfile) + if backup_user is not work_user: + gencmd = 'su -c %s - %s' % (commands.mkarg(gencmd), backup_user) debug(gencmd) if os.system(gencmd): error('%s: Failed to generate key %s. Skipping client.' % (id, privatekeyfile)) @@ -676,7 +679,6 @@ if identity: basessh += ' -i %s' % (commands.mkarg(identity)) if status or deploy: - if identity: cmd = "ssh -i %s" % (commands.mkarg(identity)) cmd = '%s %s@%s "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"' % (basessh, cfg['user'], cfg['host']) debug(cmd) out = os.popen(cmd, 'r') @@ -798,8 +800,8 @@ except getopt.GetoptError: usage(2) + global backup_user, home_dir mode = None - user = None email = [] smtp = None cfgfile = None @@ -875,8 +877,8 @@ props = parse_prop_file(cfgfile) else: props = {} - if 'user' in props: - user = props['user'] + if 'backup.user' in props: + backup_user = props['backup.user'] if 'email.smtp.server' in props: smtp = props['email.smtp.server'] if 'email.to' in props: @@ -884,7 +886,21 @@ if len(cfglocs) == 0: locs = os.path.join(config_dir, 'clients.d') if os.path.isdir(locs): cfglocs.append(locs) + + 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) + os.env['HOME'] = home_dir + else: + backup_user = work_user + home_dir = os.getenv('HOME', '/') + + if len(cfglocs) > 0: cfgs = parse_locs(cfglocs) + else: + cfgs = {} if mode is 'client': if len(args) > 0: usage(2) @@ -898,13 +914,6 @@ ok = False if not ok: sys.exit(2) - if user and mode is not 'keys': - import pwd - (name, passwd, uid, gid, gecos, dir, shell) = pwd.getpwnam(user) - os.setregid(gid, gid) - os.setreuid(uid, uid) - os.env['HOME'] = dir - try: global is_client, verbosity_level if mode is 'server': Modified: safekeep/trunk/sample.conf =================================================================== --- safekeep/trunk/sample.conf 2007-03-08 03:44:20 UTC (rev 443) +++ safekeep/trunk/sample.conf 2007-03-08 20:27:15 UTC (rev 444) @@ -5,7 +5,7 @@ # - leading and trailing blanks are ignored # the user under which the server will run -# user = safekeep +# backup.user = safekeep # a comma separated list of emails to receive the logs # email.to=pe...@co...,ro...@co... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-08 03:44:21
|
Revision: 443 http://safekeep.svn.sourceforge.net/safekeep/?rev=443&view=rev Author: dimi Date: 2007-03-07 19:44:20 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Teach safekeep to switch to a given user in server mode. Controlled via the 'user' property in /etc/safekeep/safekeep.conf Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/sample.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2007-03-07 22:40:01 UTC (rev 442) +++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 03:44:20 UTC (rev 443) @@ -34,6 +34,11 @@ If not specified, `safekeep` will just use `/usr/sbin/sendmail` to deliver the mail. +user:: + The Unix user under which the server will run. + If not specified, `safekeep` will just run under the + current user. + FILES ----- /etc/safekeep/safekeep.conf Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 22:40:01 UTC (rev 442) +++ safekeep/trunk/safekeep 2007-03-08 03:44:20 UTC (rev 443) @@ -799,6 +799,7 @@ usage(2) mode = None + user = None email = [] smtp = None cfgfile = None @@ -874,6 +875,8 @@ props = parse_prop_file(cfgfile) else: props = {} + if 'user' in props: + user = props['user'] if 'email.smtp.server' in props: smtp = props['email.smtp.server'] if 'email.to' in props: @@ -895,6 +898,13 @@ ok = False if not ok: sys.exit(2) + if user and mode is not 'keys': + import pwd + (name, passwd, uid, gid, gecos, dir, shell) = pwd.getpwnam(user) + os.setregid(gid, gid) + os.setreuid(uid, uid) + os.env['HOME'] = dir + try: global is_client, verbosity_level if mode is 'server': Modified: safekeep/trunk/sample.conf =================================================================== --- safekeep/trunk/sample.conf 2007-03-07 22:40:01 UTC (rev 442) +++ safekeep/trunk/sample.conf 2007-03-08 03:44:20 UTC (rev 443) @@ -4,6 +4,9 @@ # - keys are separated from values by '=' # - leading and trailing blanks are ignored +# the user under which the server will run +# user = safekeep + # a comma separated list of emails to receive the logs # email.to=pe...@co...,ro...@co... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 22:40:10
|
Revision: 442 http://safekeep.svn.sourceforge.net/safekeep/?rev=442&view=rev Author: dimi Date: 2007-03-07 14:40:01 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Allow for the explicit spcification of an identity file during key management Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-07 21:28:11 UTC (rev 441) +++ safekeep/trunk/doc/safekeep.txt 2007-03-07 22:40:01 UTC (rev 442) @@ -9,7 +9,7 @@ -------- 'safekeep' [--server] [-q] [-v] [-c file] <clientid>* -'safekeep' --keys [-q] [-v] [-c file] [--status] [--print] [--deploy] <clientid>* +'safekeep' --keys [-q] [-v] [-c file] [-i file] [--status] [--print] [--deploy] <clientid>* 'safekeep' --client @@ -90,6 +90,11 @@ KEYS OPTIONS ------------ +-i FILE:: + Forces `ssh(1)` to use FILE for the identity (private key) in + RSA/DSA authentication. If not specified, ssh(1) will use its + default indetity files. + --status:: Display the key status for the clients. It is implied if no other option is specified. In effect this option prints the steps that Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 21:28:11 UTC (rev 441) +++ safekeep/trunk/safekeep 2007-03-07 22:40:01 UTC (rev 442) @@ -622,7 +622,7 @@ info('------------------------------------------------------------------') debug('Server backup done') -def do_keys(cfgs, ids, status, dump, deploy): +def do_keys(cfgs, ids, identity, status, dump, deploy): for cfg in cfgs.itervalues(): id = cfg['id'] if ids and id not in ids: continue @@ -671,8 +671,13 @@ output = '\n'.join(lines) if dump: print output + + basessh = 'ssh' + if identity: basessh += ' -i %s' % (commands.mkarg(identity)) + if status or deploy: - cmd = 'ssh %s@%s "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"' % (cfg['user'], cfg['host']) + if identity: cmd = "ssh -i %s" % (commands.mkarg(identity)) + cmd = '%s %s@%s "if test -f .ssh/authorized_keys; then cat .ssh/authorized_keys; fi"' % (basessh, cfg['user'], cfg['host']) debug(cmd) out = os.popen(cmd, 'r') authtext = out.read() @@ -694,7 +699,7 @@ if status: print '%s: Keys will be deployed on the client.' % id if deploy: - cmd = 'ssh %s@%s "umask 077; test -d .ssh || mkdir .ssh; cat >> .ssh/authorized_keys"' % (cfg['user'], cfg['host']) + cmd = '%s %s@%s "umask 077; test -d .ssh || mkdir .ssh; cat >> .ssh/authorized_keys"' % (basessh, cfg['user'], cfg['host']) debug(cmd) pipe = os.popen(cmd, 'w') pipe.write('%s\n' % '\n'.join([key[4] for key in new_keys])) @@ -777,6 +782,7 @@ print '-V, --version show the version number and exit' print print 'keys options:' + print '-i FILE use FILE as identity for RSA/DSA authentication' print '--status display the key status for the clients (default)' print '--print display the authorization keys' print '--deploy deploy the authorization keys' @@ -784,7 +790,7 @@ def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'c:e:hs:qvV', + opts, args = getopt.getopt(sys.argv[1:], 'c:e:i:hs:qvV', [ 'conf=', 'client', 'clientid=', 'deploy', 'email=', 'help', 'keys', 'print', 'quiet', 'server', 'smtp=', 'status', @@ -799,6 +805,7 @@ cfglocs = [] verbosity = 0 clientid = None + identity = None keys_status = None keys_print = None keys_deploy = None @@ -831,6 +838,8 @@ elif o in ('--keys', ): if mode: usage(2) mode = 'keys' + elif o in ('-i', ): + identity = a elif o in ('--status', ): keys_status = True elif o in ('--print', ): @@ -848,7 +857,7 @@ if mode is None: mode = 'server' - if mode is not 'keys' and (keys_status or keys_print or keys_deploy): + if mode is not 'keys' and (identity or keys_status or keys_print or keys_deploy): usage(2) if mode is not 'server' and (email or smtp): @@ -901,7 +910,7 @@ verbosity_level = 1 + verbosity if not keys_status and not keys_print and not keys_deploy: keys_status = True - do_keys(cfgs, args, keys_status, keys_print, keys_deploy) + do_keys(cfgs, args, identity, keys_status, keys_print, keys_deploy) else: assert False, 'Unkown mode: ' + mode except Exception, ex: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 21:28:12
|
Revision: 441 http://safekeep.svn.sourceforge.net/safekeep/?rev=441&view=rev Author: dimi Date: 2007-03-07 13:28:11 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Deprecate the ability to specify client config files on the command line Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-07 19:13:40 UTC (rev 440) +++ safekeep/trunk/doc/safekeep.txt 2007-03-07 21:28:11 UTC (rev 441) @@ -82,13 +82,10 @@ SERVER OPTIONS -------------- --c, --conf=FILE|DIR:: +-c, --conf=FILE:: Specifies the configuration file location. - This can be a single file (for a single client configuration) - or a directory containing several configuration files (one per - backup client). Can be specified multiple times. - If not specified at all, SafeKeep will default in non-client mode - to searching `/etc/safekeep/clients.d/` for configuration files. + If not specified at all, SafeKeep will default to + `/etc/safekeep/safekeep.conf` if it exists. Simply using this default is the recommended usage. KEYS OPTIONS Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 19:13:40 UTC (rev 440) +++ safekeep/trunk/safekeep 2007-03-07 21:28:11 UTC (rev 441) @@ -770,7 +770,7 @@ print '--keys launch in keys management mode' print print 'common options:' - print '-c, --conf=FILE|DIR use the given configuration file/directory' + print '-c, --conf=FILE use the FILE configuration file' print '-h, --help show this help message and exit' print '-q, --quiet decreases the verbosity level' print '-v, --verbose increases the verbosity level' @@ -805,6 +805,7 @@ for o, a in opts: if o in ('-c', '--conf'): if os.path.isdir(a) or a.endswith(config_ext): + warn('Adding client config files/dirs via this switch is deprecated') cfglocs.append(a) elif cfgfile is None: cfgfile = a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 19:13:42
|
Revision: 440 http://safekeep.svn.sourceforge.net/safekeep/?rev=440&view=rev Author: dimi Date: 2007-03-07 11:13:40 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Fix the local test Modified Paths: -------------- safekeep/trunk/safekeep-test Modified: safekeep/trunk/safekeep-test =================================================================== --- safekeep/trunk/safekeep-test 2007-03-07 19:13:27 UTC (rev 439) +++ safekeep/trunk/safekeep-test 2007-03-07 19:13:40 UTC (rev 440) @@ -133,7 +133,7 @@ </data> </backup> """ - writefile(os.path.join(tmproot, 'test.conf'), CONFIG % params) + writefile(os.path.join(tmproot, 'test.backup'), CONFIG % params) for i in xrange(test_reps): FILES = ( 'data/fileA.out', @@ -149,7 +149,7 @@ cmd = "cd %(tmproot)s/client; find -type f -a \! -name '*.nobackup' | sort | xargs md5sum > %(tmproot)s/md5sums.client" if os.system(cmd % params): raise TestFailure("Can't compute the source MD5 sums") - cmd = "safekeep %(args)s --conf '%(tmproot)s/test.conf'" + cmd = "safekeep %(args)s --conf '%(tmproot)s/test.backup'" if os.system(cmd % params): raise TestFailure("Can't backup files") os.mkdir(os.path.join(tmproot, 'restore')) @@ -350,7 +350,7 @@ </backup> """ % (client, key_data, snap_conf) - writefile('/etc/safekeep.d/test-client.conf', conf, '664', 'w', 'root', server) + writefile('/etc/safekeep/clients.d/test-client.backup', conf, '664', 'w', 'root', server) cmd = 'rm -rf client; mkdir -p client/data' rcmd(cmd, 'safekeep', server, 'create data repo') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 19:13:28
|
Revision: 439 http://safekeep.svn.sourceforge.net/safekeep/?rev=439&view=rev Author: dimi Date: 2007-03-07 11:13:27 -0800 (Wed, 07 Mar 2007) Log Message: ----------- We always need a props dict Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 19:07:40 UTC (rev 438) +++ safekeep/trunk/safekeep 2007-03-07 19:13:27 UTC (rev 439) @@ -862,6 +862,8 @@ if os.path.isfile(propfile): cfgfile = propfile if cfgfile: props = parse_prop_file(cfgfile) + else: + props = {} if 'email.smtp.server' in props: smtp = props['email.smtp.server'] if 'email.to' in props: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 19:07:41
|
Revision: 438 http://safekeep.svn.sourceforge.net/safekeep/?rev=438&view=rev Author: dimi Date: 2007-03-07 11:07:40 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Look at the default configuration files only if they exist Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 16:54:47 UTC (rev 437) +++ safekeep/trunk/safekeep 2007-03-07 19:07:40 UTC (rev 438) @@ -858,15 +858,17 @@ if mode is not 'client': if cfgfile is None: - cfgfile = os.path.join(config_dir, 'safekeep.conf') - props = parse_prop_file(cfgfile) + propfile = os.path.join(config_dir, 'safekeep.conf') + if os.path.isfile(propfile): cfgfile = propfile + if cfgfile: + props = parse_prop_file(cfgfile) if 'email.smtp.server' in props: smtp = props['email.smtp.server'] if 'email.to' in props: email = props['email.to'].split(',') if len(cfglocs) == 0: locs = os.path.join(config_dir, 'clients.d') - cfglocs.append(locs) + if os.path.isdir(locs): cfglocs.append(locs) cfgs = parse_locs(cfglocs) if mode is 'client': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 16:54:49
|
Revision: 437 http://safekeep.svn.sourceforge.net/safekeep/?rev=437&view=rev Author: dimi Date: 2007-03-07 08:54:47 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Mention the new conf file Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-07 16:52:20 UTC (rev 436) +++ safekeep/trunk/doc/safekeep.txt 2007-03-07 16:54:47 UTC (rev 437) @@ -236,7 +236,7 @@ SEE ALSO -------- -rdiff-backup(1), safekeep.backup(5) +rdiff-backup(1), safekeep.conf(5), safekeep.backup(5) AUTHOR ------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 16:52:24
|
Revision: 436 http://safekeep.svn.sourceforge.net/safekeep/?rev=436&view=rev Author: dimi Date: 2007-03-07 08:52:20 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Deprecate the email options Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-07 16:28:08 UTC (rev 435) +++ safekeep/trunk/doc/safekeep.txt 2007-03-07 16:52:20 UTC (rev 436) @@ -7,7 +7,7 @@ SYNOPSIS -------- -'safekeep' [--server] [-q] [-v] [-c file] [-e <email>] [-s <smtp>] <clientid>* +'safekeep' [--server] [-q] [-v] [-c file] <clientid>* 'safekeep' --keys [-q] [-v] [-c file] [--status] [--print] [--deploy] <clientid>* @@ -91,16 +91,6 @@ to searching `/etc/safekeep/clients.d/` for configuration files. Simply using this default is the recommended usage. --e, --email=EMAIL:: - In addition to writing the session logs - on the standard output, this parameter let the user specify - the mail address where the logs are to be send. Can be specified - more than once to send reports to multiple addresses. - --s, --smtp=SMTP:: - Specifies the SMTP server used for sending mails when `-e` is used. - Defaults to using `/usr/sbin/sendmail`. - KEYS OPTIONS ------------ --status:: Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-07 16:28:08 UTC (rev 435) +++ safekeep/trunk/safekeep 2007-03-07 16:52:20 UTC (rev 436) @@ -776,10 +776,6 @@ print '-v, --verbose increases the verbosity level' print '-V, --version show the version number and exit' print - print 'server options:' - print '-e, --email=EMAIL send results by email (can appear multiple times)' - print '-s, --smtp=SMTP SMTP server to use when sending mails (default: sendmail)' - print print 'keys options:' print '--status display the key status for the clients (default)' print '--print display the authorization keys' @@ -816,10 +812,14 @@ error('A main configuration file can be specified only once!') sys.exit(2) elif o in ('-e', '--email'): + warn('The -e/--email options are deprecated and will be removed in the future') + warn('Please use the /etc/safekeep/safekeep.conf file instead') email.append(a) elif o in ('-h', '--help'): usage(0) elif o in ('-s', '--smtp'): + warn('The -s/--smtp options are deprecated and will be removed in the future') + warn('Please use the /etc/safekeep/safekeep.conf file instead') smtp = a elif o in ('--server', ): if mode: usage(2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 16:28:17
|
Revision: 435 http://safekeep.svn.sourceforge.net/safekeep/?rev=435&view=rev Author: dimi Date: 2007-03-07 08:28:08 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Add man page for safekeep.conf Modified Paths: -------------- safekeep/trunk/Makefile safekeep/trunk/debian/rules safekeep/trunk/debian/safekeep-server.docs safekeep/trunk/safekeep.spec.in Added Paths: ----------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/sample.conf Modified: safekeep/trunk/Makefile =================================================================== --- safekeep/trunk/Makefile 2007-03-07 15:23:08 UTC (rev 434) +++ safekeep/trunk/Makefile 2007-03-07 16:28:08 UTC (rev 435) @@ -10,8 +10,8 @@ dirname := $(shell basename $(PWD)) rpmroot := $(shell grep '%_topdir' ~/.rpmmacros | sed 's/^[^ \t]*[ \t]*//') svnroot := $(shell LANG=C svn info | grep Root | cut -c 18-) -MAN_TXT := doc/safekeep.txt doc/safekeep.backup.txt -DOC_MAN := doc/safekeep.1 doc/safekeep.backup.5 +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)) @@ -78,6 +78,7 @@ install: $(DOC_MAN) install -m 755 safekeep "/usr/bin/" 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/" if test -d /etc/safekeep.d; then \ for file in /etc/safekeep.d/*.conf; do \ Modified: safekeep/trunk/debian/rules =================================================================== --- safekeep/trunk/debian/rules 2007-03-07 15:23:08 UTC (rev 434) +++ safekeep/trunk/debian/rules 2007-03-07 16:28:08 UTC (rev 435) @@ -18,6 +18,7 @@ install -d -m 755 $(CURDIR)/debian/safekeep-common/usr/share/man/{man1,man5} install -m 755 safekeep $(CURDIR)/debian/safekeep-common/usr/bin install -m 755 doc/safekeep.1 $(CURDIR)/debian/safekeep-common/usr/share/man/man1 + install -m 755 doc/safekeep.conf.5 $(CURDIR)/debian/safekeep-common/usr/share/man/man5 install -m 755 doc/safekeep.backup.5 $(CURDIR)/debian/safekeep-common/usr/share/man/man5 install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/safekeep/clients.d Modified: safekeep/trunk/debian/safekeep-server.docs =================================================================== --- safekeep/trunk/debian/safekeep-server.docs 2007-03-07 15:23:08 UTC (rev 434) +++ safekeep/trunk/debian/safekeep-server.docs 2007-03-07 16:28:08 UTC (rev 435) @@ -2,4 +2,5 @@ COPYING LICENSE safekeep-test +sample.conf sample.backup Added: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt (rev 0) +++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-07 16:28:08 UTC (rev 435) @@ -0,0 +1,44 @@ +safekeep.conf(5) +================ + +NAME +---- +safekeep.conf - Configuration file for 'safekeep(1)' + +SYNOPSIS +-------- +This file resides in `/etc/safekeep/` from where it +will be automatically picked up by 'safekeep(1)'. + +DESCRIPTION +----------- +This configuration file holds safekeep global settings. +The format of the file is a simple key-value pair similar +to Java properties files: lines starting with '#' are ignored +as comments, keys are separated from values by '=', and +leading and trailing spaces are ignored. + +PARAMETERS +---------- +email.to:: + In addition to writing the session logs + on the standard output, `safekeep` can also send the + logs via email to a number of recipients. + This comma-separated list of emails designates + the recipients of the logs. If not specified, + `safekeep` will not attempt to email the logs. + +email.smtp.server:: + Specifies the SMTP server used for sending mails + if the `email.to` specifies any recipients. + If not specified, `safekeep` will just use + `/usr/sbin/sendmail` to deliver the mail. + +FILES +----- + /etc/safekeep/safekeep.conf + +SEE ALSO +-------- +safekeep(1), safekeep.backup(5), rdiff-backup(1), lvcreate(8) + Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2007-03-07 15:23:08 UTC (rev 434) +++ safekeep/trunk/safekeep.spec.in 2007-03-07 16:28:08 UTC (rev 435) @@ -79,6 +79,7 @@ install -d -m 755 "%{buildroot}%{_mandir}/man1/" install -m 755 doc/safekeep.1 "%{buildroot}%{_mandir}/man1/" install -d -m 755 "%{buildroot}%{_mandir}/man5/" +install -m 755 doc/safekeep.conf.5 "%{buildroot}%{_mandir}/man5/" install -m 755 doc/safekeep.backup.5 "%{buildroot}%{_mandir}/man5/" install -d -m 750 "%{buildroot}%{homedir}" install -d -m 700 "%{buildroot}%{homedir}/.ssh" @@ -108,6 +109,7 @@ %defattr(-,root,root,-) %{_bindir}/safekeep %{_mandir}/man1/safekeep.1* +%{_mandir}/man5/safekeep.conf.5* %{_mandir}/man5/safekeep.backup.5* %doc AUTHORS COPYING LICENSE README TODO @@ -119,7 +121,7 @@ %attr(700,%{name},%{name}) %dir %{homedir}/.ssh %dir %{_sysconfdir}/safekeep %config %{_sysconfdir}/cron.daily/safekeep -%doc safekeep-test sample.backup +%doc safekeep-test sample.conf sample.backup %doc AUTHORS COPYING LICENSE %changelog Added: safekeep/trunk/sample.conf =================================================================== --- safekeep/trunk/sample.conf (rev 0) +++ safekeep/trunk/sample.conf 2007-03-07 16:28:08 UTC (rev 435) @@ -0,0 +1,11 @@ +# This is a sample file for safekeep(1) +# The format is similar to Java .properties files: +# - lines starting with '#' are ignored +# - keys are separated from values by '=' +# - leading and trailing blanks are ignored + +# a comma separated list of emails to receive the logs +# email.to=pe...@co...,ro...@co... + +# a SMTP server to use to deliver email if email.to is non-empty +# email.smtp.server=mail.company.com This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-07 15:23:11
|
Revision: 434 http://safekeep.svn.sourceforge.net/safekeep/?rev=434&view=rev Author: dimi Date: 2007-03-07 07:23:08 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Complete the renaming of safekeep.conf.txt into safekeep.backup.txt Modified Paths: -------------- safekeep/trunk/Makefile safekeep/trunk/debian/rules safekeep/trunk/debian/safekeep-server.docs safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep.spec.in Added Paths: ----------- safekeep/trunk/sample.backup Removed Paths: ------------- safekeep/trunk/sample.conf Modified: safekeep/trunk/Makefile =================================================================== --- safekeep/trunk/Makefile 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/Makefile 2007-03-07 15:23:08 UTC (rev 434) @@ -10,8 +10,8 @@ dirname := $(shell basename $(PWD)) rpmroot := $(shell grep '%_topdir' ~/.rpmmacros | sed 's/^[^ \t]*[ \t]*//') svnroot := $(shell LANG=C svn info | grep Root | cut -c 18-) -MAN_TXT := doc/safekeep.txt doc/safekeep.conf.txt -DOC_MAN := doc/safekeep.1 doc/safekeep.conf.5 +MAN_TXT := doc/safekeep.txt doc/safekeep.backup.txt +DOC_MAN := doc/safekeep.1 doc/safekeep.backup.5 DOC_HTML := $(patsubst %.txt,%.html,$(MAN_TXT)) @@ -78,7 +78,7 @@ install: $(DOC_MAN) install -m 755 safekeep "/usr/bin/" 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/" if test -d /etc/safekeep.d; then \ for file in /etc/safekeep.d/*.conf; do \ if test -f "$$file"; then \ Modified: safekeep/trunk/debian/rules =================================================================== --- safekeep/trunk/debian/rules 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/debian/rules 2007-03-07 15:23:08 UTC (rev 434) @@ -18,7 +18,7 @@ install -d -m 755 $(CURDIR)/debian/safekeep-common/usr/share/man/{man1,man5} install -m 755 safekeep $(CURDIR)/debian/safekeep-common/usr/bin install -m 755 doc/safekeep.1 $(CURDIR)/debian/safekeep-common/usr/share/man/man1 - install -m 755 doc/safekeep.conf.5 $(CURDIR)/debian/safekeep-common/usr/share/man/man5 + install -m 755 doc/safekeep.backup.5 $(CURDIR)/debian/safekeep-common/usr/share/man/man5 install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/safekeep/clients.d install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/cron.daily Modified: safekeep/trunk/debian/safekeep-server.docs =================================================================== --- safekeep/trunk/debian/safekeep-server.docs 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/debian/safekeep-server.docs 2007-03-07 15:23:08 UTC (rev 434) @@ -2,4 +2,4 @@ COPYING LICENSE safekeep-test -sample.conf +sample.backup Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/doc/safekeep.backup.txt 2007-03-07 15:23:08 UTC (rev 434) @@ -3,18 +3,18 @@ NAME ---- -safekeep.backup - Configuration file for 'safekeep(1)' +safekeep.backup - Configuration file for a 'safekeep(1)' client SYNOPSIS -------- These files are usually placed in `/etc/safekeep/clients.d/` to be picked -up automatically be 'safekeep(1)'. They must have a `.conf` extension. +up automatically by 'safekeep(1)'. They must have a `.backup` extension. DESCRIPTION ----------- Each configuration file controls the backup of a host. They are typically named after the hostname of the machine they control the backup for, and -have a '.conf' extension (e.g. `mailbox.conf`). These files are written +have a '.backup' extension (e.g. `mailbox.backup`). These files are written in XML. Virtually all elements and attributes are optional; if not present, `safekeep(1)` will provide reasonable, useful defaults. Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/safekeep.spec.in 2007-03-07 15:23:08 UTC (rev 434) @@ -79,7 +79,7 @@ install -d -m 755 "%{buildroot}%{_mandir}/man1/" install -m 755 doc/safekeep.1 "%{buildroot}%{_mandir}/man1/" install -d -m 755 "%{buildroot}%{_mandir}/man5/" -install -m 755 doc/safekeep.conf.5 "%{buildroot}%{_mandir}/man5/" +install -m 755 doc/safekeep.backup.5 "%{buildroot}%{_mandir}/man5/" install -d -m 750 "%{buildroot}%{homedir}" install -d -m 700 "%{buildroot}%{homedir}/.ssh" @@ -108,7 +108,7 @@ %defattr(-,root,root,-) %{_bindir}/safekeep %{_mandir}/man1/safekeep.1* -%{_mandir}/man5/safekeep.conf.5* +%{_mandir}/man5/safekeep.backup.5* %doc AUTHORS COPYING LICENSE README TODO %files client @@ -119,7 +119,7 @@ %attr(700,%{name},%{name}) %dir %{homedir}/.ssh %dir %{_sysconfdir}/safekeep %config %{_sysconfdir}/cron.daily/safekeep -%doc safekeep-test sample.conf +%doc safekeep-test sample.backup %doc AUTHORS COPYING LICENSE %changelog Copied: safekeep/trunk/sample.backup (from rev 425, safekeep/trunk/sample.conf) =================================================================== --- safekeep/trunk/sample.backup (rev 0) +++ safekeep/trunk/sample.backup 2007-03-07 15:23:08 UTC (rev 434) @@ -0,0 +1,55 @@ +<!-- the client backup id --> +<backup id="my_workstation"> + + <!-- the client backup host, the user under which the servers will connect, + the SSH keys used for launching "safekeep -c" and "rdiff-backup" --> + <host + name="my_box.corp.com" user="root" + key-ctrl="/home/jdoe/.ssh/backup_id_dsa" + key-data="/home/jdoe/.ssh/backup2_id_dsa" + /> + + <!-- location where the backuped data will be stored on the server + and for how long (s=sec, m=min, h=hours, D=days, W=weeks, M=months, or Y=years) --> + <repo + path="./data" + retention="10D" + /> + + <!-- settings for database dump and for volume snapshot --> + <setup> + + <!-- database type ("postgres" or "mysql"), user with backup rights, + location of the dump file on the client host, and flag to remove + or not the dump file after the backup is done --> + <dump + type="postgres" + db="dbname" + user="foobar" + file="/var/backup/dumps/mydata" + cleanup="true" + /> + + <!-- what volume is to be snapshoted (device location) and the size + of the snapshot (unallocated space must exist in the volume group) --> + <snapshot + device="/path/to/volume" + size="500M" + /> + + </setup> + + <!-- data to be backuped --> + <data> + <!-- each type of tag can be present more than one time --> + <!-- if a database dump was created, it must be added in this section --> + <include path="/home"/> + <exclude path="/home/guest"/> + + <include glob="**/important/"/> + <exclude glob="/home/*/tmp"/> + + <include regexp=".*\.ogg"/> + <exclude regexp=".*\.mp3"/> + </data> +</backup> Deleted: safekeep/trunk/sample.conf =================================================================== --- safekeep/trunk/sample.conf 2007-03-06 21:15:27 UTC (rev 433) +++ safekeep/trunk/sample.conf 2007-03-07 15:23:08 UTC (rev 434) @@ -1,55 +0,0 @@ -<!-- the client backup id --> -<backup id="my_workstation"> - - <!-- the client backup host, the user under which the servers will connect, - the SSH keys used for launching "safekeep -c" and "rdiff-backup" --> - <host - name="my_box.corp.com" user="root" - key-ctrl="/home/jdoe/.ssh/backup_id_dsa" - key-data="/home/jdoe/.ssh/backup2_id_dsa" - /> - - <!-- location where the backuped data will be stored on the server - and for how long (s=sec, m=min, h=hours, D=days, W=weeks, M=months, or Y=years) --> - <repo - path="./data" - retention="10D" - /> - - <!-- settings for database dump and for volume snapshot --> - <setup> - - <!-- database type ("postgres" or "mysql"), user with backup rights, - location of the dump file on the client host, and flag to remove - or not the dump file after the backup is done --> - <dump - type="postgres" - db="dbname" - user="foobar" - file="/var/backup/dumps/mydata" - cleanup="true" - /> - - <!-- what volume is to be snapshoted (device location) and the size - of the snapshot (unallocated space must exist in the volume group) --> - <snapshot - device="/path/to/volume" - size="500M" - /> - - </setup> - - <!-- data to be backuped --> - <data> - <!-- each type of tag can be present more than one time --> - <!-- if a database dump was created, it must be added in this section --> - <include path="/home"/> - <exclude path="/home/guest"/> - - <include glob="**/important/"/> - <exclude glob="/home/*/tmp"/> - - <include regexp=".*\.ogg"/> - <exclude regexp=".*\.mp3"/> - </data> -</backup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-06 21:15:29
|
Revision: 433 http://safekeep.svn.sourceforge.net/safekeep/?rev=433&view=rev Author: dimi Date: 2007-03-06 13:15:27 -0800 (Tue, 06 Mar 2007) Log Message: ----------- Rename the man page safekeep.conf to safekeep.backup to match the new naming convention. Adjust the docs to the new directory structure. Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt Added Paths: ----------- safekeep/trunk/doc/safekeep.backup.txt Removed Paths: ------------- safekeep/trunk/doc/safekeep.conf.txt Copied: safekeep/trunk/doc/safekeep.backup.txt (from rev 425, safekeep/trunk/doc/safekeep.conf.txt) =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt (rev 0) +++ safekeep/trunk/doc/safekeep.backup.txt 2007-03-06 21:15:27 UTC (rev 433) @@ -0,0 +1,254 @@ +safekeep.backup(5) +================ + +NAME +---- +safekeep.backup - Configuration file for 'safekeep(1)' + +SYNOPSIS +-------- +These files are usually placed in `/etc/safekeep/clients.d/` to be picked +up automatically be 'safekeep(1)'. They must have a `.conf` extension. + +DESCRIPTION +----------- +Each configuration file controls the backup of a host. They are typically +named after the hostname of the machine they control the backup for, and +have a '.conf' extension (e.g. `mailbox.conf`). These files are written +in XML. Virtually all elements and attributes are optional; if not present, +`safekeep(1)` will provide reasonable, useful defaults. + +The full set of supported elements and attributes looks as follows: +------------------------------------------------------------------------ +<backup id="my_workstation"> + + <!-- 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" + key-ctrl="/home/jdoe/.ssh/backup_id_dsa" + key-data="/home/jdoe/.ssh/backup2_id_dsa" + /> + + <!-- location where the backups will be stored on the server + and for how long (D=days, W=weeks, M=months, or Y=years) --> + <repo path="./data" retention="10D"/> + + <!-- settings for database dump and for volume snapshot --> + <setup> + <!-- database type ("postgres" or "mysql"), user with backup rights, + location of the dump file on the client host, and flag to remove + or not the dump file after the backup is done --> + <dump + type="postgres" + db="dbname" + user="foobar" + file="/var/backup/dumps/mydata" + cleanup="true" + /> + + <!-- what volume is to be snapshot (device location) and the size + of the snapshot (free space must exist in the volume group) --> + <snapshot + device="/path/to/volume" + size="500M" + /> + + </setup> + + <!-- data to be backup --> + <data> + <!-- each type of tag can be present more than one time --> + <!-- if a database dump was created, it must be added in this section --> + <include path="/home"/> + <exclude path="/home/guest"/> + + <include glob="**/important/"/> + <exclude glob="/home/*/tmp"/> + + <include regexp=".*\.ogg"/> + <exclude regexp=".*\.mp3"/> + </data> +</backup> +------------------------------------------------------------------------ + +PARAMETERS +---------- +XML elements and attributes are referred to via XPath expressions: elements +are separated by '/', attributes are introduced by '@': + +/backup:: + The root element of the XML file. + Mandatory. + +/backup/@id:: + This is the ID by which `safekeep(1)` will address this host. + If specified it overrides the default value derived from the + filename. Use of the default value is recommended. + Optional, defaults to the filename without the `.conf` extension. + +/backup/host/@name:: + The name or IP address of the client. If you need to backup the + box that the server is running from, you can set this to "localhost". + This is different from leaving it blank, as it will establish a + SSH session and use the user specified by `/backup/host/@user`. + Optional, defaults to local access. + +/backup/host/@user:: + The user name to use when connecting to the client. This user + must have read permissions for the files that will be backed up, + so it most likely needs to be 'root'. + Optional, defaults to 'root'. + +/backup/host/@key-ctrl:: + This is the private key used to establish the SSH connection + to the client for the control channel. Use of the default value + is recommended. + Optional, defaults to `~/.ssh/safekeep-server-ctrl-key`. + +/backup/host/@key-data:: + This is the private key used to establish the SSH connection + to the client for the data channel. Use of the default value + is recommended. + Optional, defaults to `~/.ssh/safekeep-server-data-key`. + +/backup/repo/@path:: + The path under which the backups will be stored. Relative + paths are based on current working directory where `safekeep(1)` + server is run. Typically this working directory will be the home + directory of the user under which `safekeep(1)` runs on the server. + As a result, in a typical installation the data will be stored + under `/var/lib/safekeep/<id>/`. If the directory does not exist, + `safekeep(1)` will attempt to create it automatically. The backup + will fail altogether if the directory can not be created. + Optional, defaults to the client ID, see `/backup/@id`. + +/backup/repo/@retention:: + Specifies the duration for which the backup data will be retained. + The incremental backup information in the destination directory that + has been around longer than the retention time will be removed. + The value specified by this attribute is an time interval: an integer + followed by the character s, m, h, D, W, M, or Y, indicating seconds, + minutes, hours, days, weeks, months, or years respectively, or a + number of these concatenated. For example, 32m means 32 minutes, and + 3W2D10h7s means 3 weeks, 2 days, 10 hours, and 7 seconds. In this + context, a month means 30 days, a year is 365 days, and a day is + always 86400 seconds. + Note that backups of deleted files are covered by this operation. + Thus if you deleted a file two weeks ago, backed up immediately + afterward, and then ran `safekeep(1)` with a retention of '10D' + today, no trace of that file would remain. Finally, file selection + options don't affect removal of incremental data. + Optional, defaults to empty (unlimited retention). + +/backup/setup/dump/@type:: + One of "postgres" or "mysql". + Mandatory for a `<dump>` element. + +/backup/setup/dump/@db:: + Name of the database to dump. If not specified, it defaults + to all databases maintained in the RDBMS specified by `type`. + Optional, defaults to all databases. + +/backup/setup/dump/@dbuser:: + Name of the database user to use while doing the dump. + Optional, defaults to whatever the database determines + based on the system user. + +/backup/setup/dump/@user:: + The system user under which the dump should take place. + Please note that using this feature requires that `safekeep(1)` + runs as `root` on the client. + Optional, defaults to the user under which `safekeep(1)` runs + on the client side. + +/backup/setup/dump/@file:: + The full path to the dump file on the client host. + Mandatory for a `<dump>` element. + +/backup/setup/dump/@cleanup:: + One of "true" or "false". If "true", the dump file will + be deleted from the client system once the backup is over. + It is usually futile to delete it, since it will be created + for each backup, and hence you will need to have the space + available. + Optional, defaults to "false". + +/backup/setup/snapshot/@device:: + The path (device location) to the LVM volume to snapshot + before the backup commences. It is recommended + Please note that using this feature requires that `safekeep(1)` + runs as `root` on the client. + Mandatory for a `<snapshot>` element. + +/backup/setup/snapshot/@size:: + The size of the snapshot. Unallocated space must exist on + the volume group. It is recommended that it is about 15-20% + of the original device's size. + Mandatory for a `<snapshot>` element. + +/backup/data/exclude/@path:: + Exclude the file or files matched by the path. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +/backup/data/include/@path:: + Include the file or files matched by the path. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +/backup/data/exclude/@glob:: + Exclude the file or files matched by the shell pattern. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +/backup/data/include/@glob:: + Include the file or files matched by the shell pattern. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +/backup/data/exclude/@regexp:: + Exclude the file or files matched by the regular expression. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +/backup/data/include/@regexp:: + Include the file or files matched by the regular expression. + If a directory is matched, then files under that directory will also + be matched. + See the `FILE SELECTION` section for more information. + +FILE SELECTION +-------------- +`safekeep(1)` supports file selection options similar to `rdiff-backup(1)`. +When rdiff-backup is run, it searches through the given source directory +and backs up all the files specified by the file selection system. + +The file selection system comprises a number of file selection conditions, +which are set using one of the `<include>`/`<exclude>` elements. +Each file selection condition either matches or doesn't match a given file. +A given file is included or excluded by the file selection system when the +first matching file selection condition specifies that the file be included +or excluded respecively; if the file matches no include or exclude +statement, it is by default excluded. + +When backing up, if a file is excluded, `safekeep(1)` acts +as if that file does not exist in the source directory. + +For more information on file selection semantics, please see +`rdiff-backup(1)`. + + +FILES +----- + /etc/safekeep/clients.d/ + +SEE ALSO +-------- +safekeep(1), rdiff-backup(1), lvcreate(8) + Deleted: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2007-03-06 21:07:23 UTC (rev 432) +++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-06 21:15:27 UTC (rev 433) @@ -1,254 +0,0 @@ -safekeep.conf(5) -================ - -NAME ----- -safekeep.conf - Configuration file for 'safekeep(1)' - -SYNOPSIS --------- -These files are usually placed in `/etc/safekeep.d/` to be picked -up automatically be 'safekeep(1)'. They must have a `.conf` extension. - -DESCRIPTION ------------ -Each configuration file controls the backup of a host. They are typically -named after the hostname of the machine they control the backup for, and -have a '.conf' extension (e.g. `mailbox.conf`). These files are written -in XML. Virtually all elements and attributes are optional; if not present, -`safekeep(1)` will provide reasonable, useful defaults. - -The full set of supported elements and attributes looks as follows: ------------------------------------------------------------------------- -<backup id="my_workstation"> - - <!-- 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" - key-ctrl="/home/jdoe/.ssh/backup_id_dsa" - key-data="/home/jdoe/.ssh/backup2_id_dsa" - /> - - <!-- location where the backups will be stored on the server - and for how long (D=days, W=weeks, M=months, or Y=years) --> - <repo path="./data" retention="10D"/> - - <!-- settings for database dump and for volume snapshot --> - <setup> - <!-- database type ("postgres" or "mysql"), user with backup rights, - location of the dump file on the client host, and flag to remove - or not the dump file after the backup is done --> - <dump - type="postgres" - db="dbname" - user="foobar" - file="/var/backup/dumps/mydata" - cleanup="true" - /> - - <!-- what volume is to be snapshot (device location) and the size - of the snapshot (free space must exist in the volume group) --> - <snapshot - device="/path/to/volume" - size="500M" - /> - - </setup> - - <!-- data to be backup --> - <data> - <!-- each type of tag can be present more than one time --> - <!-- if a database dump was created, it must be added in this section --> - <include path="/home"/> - <exclude path="/home/guest"/> - - <include glob="**/important/"/> - <exclude glob="/home/*/tmp"/> - - <include regexp=".*\.ogg"/> - <exclude regexp=".*\.mp3"/> - </data> -</backup> ------------------------------------------------------------------------- - -PARAMETERS ----------- -XML elements and attributes are referred to via XPath expressions: elements -are separated by '/', attributes are introduced by '@': - -/backup:: - The root element of the XML file. - Mandatory. - -/backup/@id:: - This is the ID by which `safekeep(1)` will address this host. - If specified it overrides the default value derived from the - filename. Use of the default value is recommended. - Optional, defaults to the filename without the `.conf` extension. - -/backup/host/@name:: - The name or IP address of the client. If you need to backup the - box that the server is running from, you can set this to "localhost". - This is different from leaving it blank, as it will establish a - SSH session and use the user specified by `/backup/host/@user`. - Optional, defaults to local access. - -/backup/host/@user:: - The user name to use when connecting to the client. This user - must have read permissions for the files that will be backed up, - so it most likely needs to be 'root'. - Optional, defaults to 'root'. - -/backup/host/@key-ctrl:: - This is the private key used to establish the SSH connection - to the client for the control channel. Use of the default value - is recommended. - Optional, defaults to `~/.ssh/safekeep-server-ctrl-key`. - -/backup/host/@key-data:: - This is the private key used to establish the SSH connection - to the client for the data channel. Use of the default value - is recommended. - Optional, defaults to `~/.ssh/safekeep-server-data-key`. - -/backup/repo/@path:: - The path under which the backups will be stored. Relative - paths are based on current working directory where `safekeep(1)` - server is run. Typically this working directory will be the home - directory of the user under which `safekeep(1)` runs on the server. - As a result, in a typical installation the data will be stored - under `/var/lib/safekeep/<id>/`. If the directory does not exist, - `safekeep(1)` will attempt to create it automatically. The backup - will fail altogether if the directory can not be created. - Optional, defaults to the client ID, see `/backup/@id`. - -/backup/repo/@retention:: - Specifies the duration for which the backup data will be retained. - The incremental backup information in the destination directory that - has been around longer than the retention time will be removed. - The value specified by this attribute is an time interval: an integer - followed by the character s, m, h, D, W, M, or Y, indicating seconds, - minutes, hours, days, weeks, months, or years respectively, or a - number of these concatenated. For example, 32m means 32 minutes, and - 3W2D10h7s means 3 weeks, 2 days, 10 hours, and 7 seconds. In this - context, a month means 30 days, a year is 365 days, and a day is - always 86400 seconds. - Note that backups of deleted files are covered by this operation. - Thus if you deleted a file two weeks ago, backed up immediately - afterward, and then ran `safekeep(1)` with a retention of '10D' - today, no trace of that file would remain. Finally, file selection - options don't affect removal of incremental data. - Optional, defaults to empty (unlimited retention). - -/backup/setup/dump/@type:: - One of "postgres" or "mysql". - Mandatory for a `<dump>` element. - -/backup/setup/dump/@db:: - Name of the database to dump. If not specified, it defaults - to all databases maintained in the RDBMS specified by `type`. - Optional, defaults to all databases. - -/backup/setup/dump/@dbuser:: - Name of the database user to use while doing the dump. - Optional, defaults to whatever the database determines - based on the system user. - -/backup/setup/dump/@user:: - The system user under which the dump should take place. - Please note that using this feature requires that `safekeep(1)` - runs as `root` on the client. - Optional, defaults to the user under which `safekeep(1)` runs - on the client side. - -/backup/setup/dump/@file:: - The full path to the dump file on the client host. - Mandatory for a `<dump>` element. - -/backup/setup/dump/@cleanup:: - One of "true" or "false". If "true", the dump file will - be deleted from the client system once the backup is over. - It is usually futile to delete it, since it will be created - for each backup, and hence you will need to have the space - available. - Optional, defaults to "false". - -/backup/setup/snapshot/@device:: - The path (device location) to the LVM volume to snapshot - before the backup commences. It is recommended - Please note that using this feature requires that `safekeep(1)` - runs as `root` on the client. - Mandatory for a `<snapshot>` element. - -/backup/setup/snapshot/@size:: - The size of the snapshot. Unallocated space must exist on - the volume group. It is recommended that it is about 15-20% - of the original device's size. - Mandatory for a `<snapshot>` element. - -/backup/data/exclude/@path:: - Exclude the file or files matched by the path. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -/backup/data/include/@path:: - Include the file or files matched by the path. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -/backup/data/exclude/@glob:: - Exclude the file or files matched by the shell pattern. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -/backup/data/include/@glob:: - Include the file or files matched by the shell pattern. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -/backup/data/exclude/@regexp:: - Exclude the file or files matched by the regular expression. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -/backup/data/include/@regexp:: - Include the file or files matched by the regular expression. - If a directory is matched, then files under that directory will also - be matched. - See the `FILE SELECTION` section for more information. - -FILE SELECTION --------------- -`safekeep(1)` supports file selection options similar to `rdiff-backup(1)`. -When rdiff-backup is run, it searches through the given source directory -and backs up all the files specified by the file selection system. - -The file selection system comprises a number of file selection conditions, -which are set using one of the `<include>`/`<exclude>` elements. -Each file selection condition either matches or doesn't match a given file. -A given file is included or excluded by the file selection system when the -first matching file selection condition specifies that the file be included -or excluded respecively; if the file matches no include or exclude -statement, it is by default excluded. - -When backing up, if a file is excluded, `safekeep(1)` acts -as if that file does not exist in the source directory. - -For more information on file selection semantics, please see -`rdiff-backup(1)`. - - -FILES ------ - /etc/safekeep.d/ - -SEE ALSO --------- -safekeep(1), rdiff-backup(1), lvcreate(8) - Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-06 21:07:23 UTC (rev 432) +++ safekeep/trunk/doc/safekeep.txt 2007-03-06 21:15:27 UTC (rev 433) @@ -88,7 +88,7 @@ or a directory containing several configuration files (one per backup client). Can be specified multiple times. If not specified at all, SafeKeep will default in non-client mode - to searching `/etc/safekeep.d/` for configuration files. + to searching `/etc/safekeep/clients.d/` for configuration files. Simply using this default is the recommended usage. -e, --email=EMAIL:: @@ -119,10 +119,10 @@ CONFIGURATION ------------- -Normally the configuration files are placed in the `/etc/safekeep.d/` 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: +Normally the configuration files are placed in the `/etc/safekeep/clients.d/` +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: ------------------------------------------------------------------------ <backup> <host name="my_workstation" /> @@ -173,14 +173,14 @@ directories. Older data will be retained for 10 days. For full reference documentation of the configuration format, see -safekeep.conf(5). +safekeep.backup(5). CLIENT IDS ---------- Normally the client IDs are generated automatically from the configuration filenames without the extension. E.g. if a configuration file is named `my_workstation.conf`, the client ID becomes `my_workstation`. For more -information on this topic, see safekeep.conf(5). +information on this topic, see safekeep.backup(5). KEY DEPLOYMENT -------------- @@ -206,8 +206,8 @@ To do so, you just need to know the directory where the data is actually stored. In a typical installation, for a box configured via the file -`/etc/safekeep.d/mybox.conf`, the data will be stored under -`/var/lib/safekeep/mybox/`. Please refer to `safekeep.conf(5)` for more +`/etc/safekeep/clients.d/mybox.backup`, the data will be stored under +`/var/lib/safekeep/mybox/`. Please refer to `safekeep.backup(5)` for more information on this matter. Once you have determined where the data will be stored (we'll continue @@ -242,11 +242,11 @@ ... ------------------------------------------------------------------------ -Please see safekeep.conf(5) for more information on file selection. +Please see safekeep.backup(5) for more information on file selection. SEE ALSO -------- -rdiff-backup(1), safekeep.conf(5) +rdiff-backup(1), safekeep.backup(5) AUTHOR ------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-06 21:07:26
|
Revision: 432 http://safekeep.svn.sourceforge.net/safekeep/?rev=432&view=rev Author: dimi Date: 2007-03-06 13:07:23 -0800 (Tue, 06 Mar 2007) Log Message: ----------- Read the email properties from the global config file Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-06 04:52:16 UTC (rev 431) +++ safekeep/trunk/safekeep 2007-03-06 21:07:23 UTC (rev 432) @@ -798,7 +798,7 @@ mode = None email = [] - smtp = '' + smtp = None cfgfile = None cfglocs = [] verbosity = 0 @@ -859,7 +859,11 @@ if mode is not 'client': if cfgfile is None: cfgfile = os.path.join(config_dir, 'safekeep.conf') - # FIXME: parse config file + props = parse_prop_file(cfgfile) + if 'email.smtp.server' in props: + smtp = props['email.smtp.server'] + if 'email.to' in props: + email = props['email.to'].split(',') if len(cfglocs) == 0: locs = os.path.join(config_dir, 'clients.d') cfglocs.append(locs) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-06 04:52:19
|
Revision: 431 http://safekeep.svn.sourceforge.net/safekeep/?rev=431&view=rev Author: dimi Date: 2007-03-05 20:52:16 -0800 (Mon, 05 Mar 2007) Log Message: ----------- Add simple Java-like properties parser Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-06 04:11:28 UTC (rev 430) +++ safekeep/trunk/safekeep 2007-03-06 04:52:16 UTC (rev 431) @@ -108,6 +108,21 @@ 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 ###################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-06 04:11:29
|
Revision: 430 http://safekeep.svn.sourceforge.net/safekeep/?rev=430&view=rev Author: dimi Date: 2007-03-05 20:11:28 -0800 (Mon, 05 Mar 2007) Log Message: ----------- Add (partial) support for a global configuration file: /etc/safekeep/safekeep.conf Allow the -c/--conf switch to take both global conf file and client conf files as parameters. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-04 20:15:32 UTC (rev 429) +++ safekeep/trunk/safekeep 2007-03-06 04:11:28 UTC (rev 430) @@ -5,7 +5,7 @@ import xml.dom.minidom import socket, smtplib -config_dir = '/etc/safekeep/clients.d' +config_dir = '/etc/safekeep' config_ext = '.backup' logbuf = [] is_client = False @@ -784,6 +784,7 @@ mode = None email = [] smtp = '' + cfgfile = None cfglocs = [] verbosity = 0 clientid = None @@ -792,7 +793,13 @@ keys_deploy = None for o, a in opts: if o in ('-c', '--conf'): - cfglocs.append(a) + if os.path.isdir(a) or a.endswith(config_ext): + cfglocs.append(a) + elif cfgfile is None: + cfgfile = a + else: + error('A main configuration file can be specified only once!') + sys.exit(2) elif o in ('-e', '--email'): email.append(a) elif o in ('-h', '--help'): @@ -834,9 +841,14 @@ if mode is 'client' and cfglocs: usage(2) - if mode is not 'client' and len(cfglocs) == 0: - cfglocs.append(config_dir) - cfgs = parse_locs(cfglocs) + if mode is not 'client': + if cfgfile is None: + cfgfile = os.path.join(config_dir, 'safekeep.conf') + # FIXME: parse config file + if len(cfglocs) == 0: + locs = os.path.join(config_dir, 'clients.d') + cfglocs.append(locs) + cfgs = parse_locs(cfglocs) if mode is 'client': if len(args) > 0: usage(2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-04 20:15:33
|
Revision: 429 http://safekeep.svn.sourceforge.net/safekeep/?rev=429&view=rev Author: dimi Date: 2007-03-04 12:15:32 -0800 (Sun, 04 Mar 2007) Log Message: ----------- Add migration code to source install as well Modified Paths: -------------- safekeep/trunk/Makefile Modified: safekeep/trunk/Makefile =================================================================== --- safekeep/trunk/Makefile 2007-03-04 20:13:27 UTC (rev 428) +++ safekeep/trunk/Makefile 2007-03-04 20:15:32 UTC (rev 429) @@ -79,6 +79,14 @@ install -m 755 safekeep "/usr/bin/" install -m 755 doc/safekeep.1 "/usr/share/man/man1/" install -m 755 doc/safekeep.conf.5 "/usr/share/man/man5/" + if test -d /etc/safekeep.d; then \ + for file in /etc/safekeep.d/*.conf; do \ + if test -f "$$file"; then \ + mv "$$file" /etc/safekeep/clients.d/`basename "$$file" .conf`.backup \ + fi \ + done \ + rmdir /etc/safekeep.d 2> /dev/null || true \ + fi tar: tar-snapshot This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-04 20:13:28
|
Revision: 428 http://safekeep.svn.sourceforge.net/safekeep/?rev=428&view=rev Author: dimi Date: 2007-03-04 12:13:27 -0800 (Sun, 04 Mar 2007) Log Message: ----------- Move the client configuration files in /etc/safekeep/clients.d Change the extension of client config files to .backup from .client. Provide automatic migration code for DEB and RPM packages. Modified Paths: -------------- safekeep/trunk/debian/rules safekeep/trunk/debian/safekeep-server.dirs safekeep/trunk/debian/safekeep-server.postinst safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/debian/rules =================================================================== --- safekeep/trunk/debian/rules 2007-03-04 17:52:31 UTC (rev 427) +++ safekeep/trunk/debian/rules 2007-03-04 20:13:27 UTC (rev 428) @@ -20,7 +20,7 @@ install -m 755 doc/safekeep.1 $(CURDIR)/debian/safekeep-common/usr/share/man/man1 install -m 755 doc/safekeep.conf.5 $(CURDIR)/debian/safekeep-common/usr/share/man/man5 - install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/safekeep.d + install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/safekeep/clients.d install -d -m 755 $(CURDIR)/debian/safekeep-server/etc/cron.daily install -m 755 safekeep.cron $(CURDIR)/debian/safekeep-server/etc/cron.daily/safekeep Modified: safekeep/trunk/debian/safekeep-server.dirs =================================================================== --- safekeep/trunk/debian/safekeep-server.dirs 2007-03-04 17:52:31 UTC (rev 427) +++ safekeep/trunk/debian/safekeep-server.dirs 2007-03-04 20:13:27 UTC (rev 428) @@ -1,2 +1,2 @@ etc/cron.daily -etc/safekeep.d +etc/safekeep Modified: safekeep/trunk/debian/safekeep-server.postinst =================================================================== --- safekeep/trunk/debian/safekeep-server.postinst 2007-03-04 17:52:31 UTC (rev 427) +++ safekeep/trunk/debian/safekeep-server.postinst 2007-03-04 20:13:27 UTC (rev 428) @@ -6,6 +6,14 @@ configure) adduser --quiet --system --home /var/lib/safekeep safekeep install -d -m 700 -o safekeep -g nogroup /var/lib/safekeep/.ssh + if test -d /etc/safekeep.d; then + for file in /etc/safekeep.d/*.conf; do + if test -f "$file"; then + mv "$file" /etc/safekeep/clients.d/`basename "$file" .conf`.backup + fi + done + rmdir /etc/safekeep.d 2> /dev/null || true + fi ;; abort-upgrade|abort-remove|abort-deconfigure) Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-03-04 17:52:31 UTC (rev 427) +++ safekeep/trunk/safekeep 2007-03-04 20:13:27 UTC (rev 428) @@ -5,8 +5,8 @@ import xml.dom.minidom import socket, smtplib -config_dir = '/etc/safekeep.d' -config_ext = '.conf' +config_dir = '/etc/safekeep/clients.d' +config_ext = '.backup' logbuf = [] is_client = False verbosity_level = 1 Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2007-03-04 17:52:31 UTC (rev 427) +++ safekeep/trunk/safekeep.spec.in 2007-03-04 20:13:27 UTC (rev 428) @@ -71,7 +71,7 @@ make build %install -install -d -m 755 "%{buildroot}%{_sysconfdir}/safekeep.d" +install -d -m 755 "%{buildroot}%{_sysconfdir}/safekeep/clients.d" install -d -m 755 "%{buildroot}%{_sysconfdir}/cron.daily" install -m 755 safekeep.cron "%{buildroot}%{_sysconfdir}/cron.daily/safekeep" install -d -m 755 "%{buildroot}%{_bindir}/" @@ -89,6 +89,16 @@ %pre server %{_sbindir}/useradd -r -d %{homedir} -s /sbin/nologin -u 186 %{name} 2> /dev/null || : +%post server +if test -d /etc/safekeep.d; then + for file in /etc/safekeep.d/*.conf; do + if test -f "$file"; then + mv "$file" /etc/safekeep/clients.d/`basename "$file" .conf`.backup + fi + done + rmdir /etc/safekeep.d 2> /dev/null || : +fi + %preun server if [ "$1" = "0" ]; then %{_sbindir}/userdel %{name} >> /dev/null 2>&1 || : @@ -107,7 +117,7 @@ %files server %attr(750,%{name},%{name}) %dir %{homedir} %attr(700,%{name},%{name}) %dir %{homedir}/.ssh -%dir %{_sysconfdir}/safekeep.d +%dir %{_sysconfdir}/safekeep %config %{_sysconfdir}/cron.daily/safekeep %doc safekeep-test sample.conf %doc AUTHORS COPYING LICENSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-04 17:52:33
|
Revision: 427 http://safekeep.svn.sourceforge.net/safekeep/?rev=427&view=rev Author: dimi Date: 2007-03-04 09:52:31 -0800 (Sun, 04 Mar 2007) Log Message: ----------- Fix restore docs. Modified Paths: -------------- safekeep/trunk/doc/safekeep.txt Modified: safekeep/trunk/doc/safekeep.txt =================================================================== --- safekeep/trunk/doc/safekeep.txt 2007-03-04 17:52:06 UTC (rev 426) +++ safekeep/trunk/doc/safekeep.txt 2007-03-04 17:52:31 UTC (rev 427) @@ -213,7 +213,7 @@ Once you have determined where the data will be stored (we'll continue the example above), all you have to do is run `rdiff-backup`: ------------------------------------------------------------------------ - # rdiff-backup /var/lib/safekeep/mybox my-restore-dir + # rdiff-backup -r 1s /var/lib/safekeep/mybox my-restore-dir ------------------------------------------------------------------------ You will be able to find more information on the restore procedure in the `rdiff-backup(1)` man page. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-03-04 17:52:13
|
Revision: 426 http://safekeep.svn.sourceforge.net/safekeep/?rev=426&view=rev Author: dimi Date: 2007-03-04 09:52:06 -0800 (Sun, 04 Mar 2007) Log Message: ----------- Update TODO Modified Paths: -------------- safekeep/trunk/TODO Modified: safekeep/trunk/TODO =================================================================== --- safekeep/trunk/TODO 2007-02-23 22:23:12 UTC (rev 425) +++ safekeep/trunk/TODO 2007-03-04 17:52:06 UTC (rev 426) @@ -1,5 +1,7 @@ Next release: * Add configure script + an INSTALL file + * Test the sendmail delivery method + * Add a -u/--user parameter * Support more of rdiff-backup special file selectors * Add tests db dumps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <st...@us...> - 2007-02-23 22:23:16
|
Revision: 425 http://safekeep.svn.sourceforge.net/safekeep/?rev=425&view=rev Author: stelian Date: 2007-02-23 14:23:12 -0800 (Fri, 23 Feb 2007) Log Message: ----------- Do not stop if a single client fails. Separate the client outputs to ease log reading. Modified Paths: -------------- safekeep/trunk/safekeep Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2007-02-12 06:29:20 UTC (rev 424) +++ safekeep/trunk/safekeep 2007-02-23 22:23:12 UTC (rev 425) @@ -527,80 +527,84 @@ 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) - if cfg['host']: - if not os.path.isfile(cfg['key_ctrl']): - warn('Client %(id)s missing ctrl key %(key_ctrl)s, skipping' % cfg) - continue - if not os.path.isfile(cfg['key_data']): - warn('Client %(id)s missing data key %(id)s, skipping' % cfg) - continue + 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: - error('Can not create data store dir: %s' % datadir) - return + 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): - do_server_data_cleanup(cfg) + rdiff_logdir = os.path.join(datadir, 'rdiff-backup-data') + if cfg['retention'] and os.path.isdir(rdiff_logdir): + do_server_data_cleanup(cfg) - if cfg['host']: - cmd = 'ssh -T -i %(key_ctrl)s -l %(user)s %(host)s safekeep --client' % cfg - else: - cmd = 'safekeep --client' - debug('Run [' + cmd + ']') - (cin, cout) = os.popen4(cmd) + if cfg['host']: + cmd = 'ssh -T -i %(key_ctrl)s -l %(user)s %(host)s safekeep --client' % cfg + else: + cmd = 'safekeep --client' + debug('Run [' + cmd + ']') + (cin, cout) = os.popen4(cmd) - cin.write('ALOHA: %s, %s\n' % (PROTOCOL, VERSION)) - cin.flush() - client_versions = do_server_getanswer(cout) - do_server_compat(client_versions) + 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) + cin.write('CONFIG: %d: %s\n' % (len(cfg['text'].splitlines()), id)) + cin.write(cfg['text'] + '\n') + cin.flush() + do_server_getanswer(cout) - cin.write('SETUP\n') - cin.flush() - bdir = do_server_getanswer(cout) + 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 = [] + 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 + 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) + do_server_rdiff(cfg, bdir) - 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: - info_file(os.path.join(rdiff_logdir, lfn)) - else: - warn('Log dir does not exist.') + 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: + 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) + cin.write('CLEANUP %s\n' % bdir) + cin.flush() + do_server_getanswer(cout) - debug('Server backup done for client: %s' % id) + debug('Server backup done for client: %s' % id) + except Exception, e: + error(e) + error('Skipping backup for client: %s' % id) + + info('------------------------------------------------------------------') debug('Server backup done') def do_keys(cfgs, ids, status, dump, deploy): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2007-02-12 06:29:22
|
Revision: 424 http://safekeep.svn.sourceforge.net/safekeep/?rev=424&view=rev Author: dimi Date: 2007-02-11 22:29:20 -0800 (Sun, 11 Feb 2007) Log Message: ----------- Small wording fix Modified Paths: -------------- safekeep/trunk/ANNOUNCE Modified: safekeep/trunk/ANNOUNCE =================================================================== --- safekeep/trunk/ANNOUNCE 2007-02-12 06:18:06 UTC (rev 423) +++ safekeep/trunk/ANNOUNCE 2007-02-12 06:29:20 UTC (rev 424) @@ -8,9 +8,9 @@ - Automatic creation of data store directory; - A few bug fixes. -Because of lags created by using mirrors, this message may reach you -before the release is available at the public sites. The sources will -be available from the following locations: +Because of lags created by using mirrors, this message may reach you before +the release is available at the public sites. Sources and binaries will be +available from the following locations: - RedHat EL 3,4, CentOS 3,4, Fedora 4,5,6: http://prdownloads.sourceforge.net/safekeep/safekeep-common-0.9.1-1.noarch.rpm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |