From: <di...@us...> - 2008-07-17 18:52:21
|
Revision: 596 http://safekeep.svn.sourceforge.net/safekeep/?rev=596&view=rev Author: dimi Date: 2008-07-17 18:52:09 +0000 (Thu, 17 Jul 2008) Log Message: ----------- Frank Crawford <fr...@cr...> * Added options block in backup configuration file. * Added option to include special-files, i.e. device files, fifos and sockets. Default is to exclude these files. * Added option to allow inclusion of arbitrary rdiff-backup command. * Updated relevant documentation. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2008-06-27 12:55:26 UTC (rev 595) +++ safekeep/trunk/doc/safekeep.backup.txt 2008-07-17 18:52:09 UTC (rev 596) @@ -34,6 +34,10 @@ and for how long (D=days, W=weeks, M=months, or Y=years) --> <repo path="./data" retention="10D"/> + <options> + <special-files include="true"/> + </options> + <!-- settings for database dump and for volume snapshot --> <setup> <!-- database type ("postgres" or "mysql"), and database name, @@ -145,6 +149,20 @@ options don't affect removal of incremental data. Optional, defaults to empty (unlimited retention). +/backup/options/special-files/@include:: + One of "true" or "false". If "true", the dump file will + include all special files, including device files, fifo files and + socket files. + Optional, defaults to "false". + *NOTE*: specification of no options is equalent to false, but the + inclusion of other options may cause the underlying backup defaults + to be use. + +/backup/options/rdiff-backup/@append:: + Append the specified options to the current rdiff-backup run. + This is planned to be specific to the current rdiff-backup, and + different options will be made available for other backends. + /backup/setup/dump/@type:: One of "postgres" or "mysql". Mandatory for a `<dump>` element. Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-06-27 12:55:26 UTC (rev 595) +++ safekeep/trunk/safekeep 2008-07-17 18:52:09 UTC (rev 596) @@ -273,6 +273,22 @@ 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 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 = [] @@ -305,7 +321,7 @@ return { 'id': id, 'host' : host, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, - 'cludes' : cludes} + 'cludes' : cludes, 'options' : options} def parse_locs(cfglocs): cfgfiles = [] @@ -695,6 +711,27 @@ if force: args.extend(['--force']) + options_append = [] + for option in cfg['options']: + if 'special-files' in option: + if 'include' in option['special-files']: + if 'true'.startswith(option['special-files']['include'].lower()): + options_append.extend(['--include-special-files']) + else: + options_append.extend(['--exclude-special-files', '--include-symbolic-links']) + + # 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)) + + if options_append: + args.extend(options_append) + else: + args.extend(['--exclude-special-files', '--include-symbolic-links']) + #args.extend([ '-v', '6']) for clude in cfg['cludes']: opt = '--' + clude['type'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-10-07 04:42:47
|
Revision: 599 http://safekeep.svn.sourceforge.net/safekeep/?rev=599&view=rev Author: dimi Date: 2008-10-07 04:40:49 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Add support for providing the password for the DB user used for the dump. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2008-07-17 23:56:15 UTC (rev 598) +++ safekeep/trunk/doc/safekeep.backup.txt 2008-10-07 04:40:49 UTC (rev 599) @@ -177,6 +177,11 @@ Optional, defaults to whatever the database determines based on the system user. +/backup/setup/dump/@dbpasswd:: + Password of the database user to use while doing the dump. + This is currently supported only for MySQL databases. + Optional, it has no default value. + /backup/setup/dump/@user:: The system user under which the dump should take place. Please note that using this feature requires that `safekeep(1)` Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-07-17 23:56:15 UTC (rev 598) +++ safekeep/trunk/safekeep 2008-10-07 04:40:49 UTC (rev 599) @@ -209,11 +209,12 @@ db = dump_el.getAttribute('db') user = dump_el.getAttribute('user') dbuser = dump_el.getAttribute('dbuser') + dbpasswd = dump_el.getAttribute('dbpasswd') 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, + return { 'type' : type, 'db' : db, 'user' : user, 'dbuser' : dbuser, 'dbpasswd': dbpasswd, 'file' : file, 'cleanup' : cleanup } def parse_snap(snap_el): @@ -383,6 +384,8 @@ args = ['mysqldump'] if dump['dbuser']: args.extend(['-u', dump['dbuser']]) + if dump['dbpasswd']: + args.extend(['-p', dump['dbpasswd']]) if dump['db']: args.append(dump['db']) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 15:05:25
|
Revision: 619 http://safekeep.svn.sourceforge.net/safekeep/?rev=619&view=rev Author: dimi Date: 2008-11-19 15:05:21 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Remove implemented items Modified Paths: -------------- safekeep/trunk/TODO safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/TODO =================================================================== --- safekeep/trunk/TODO 2008-11-19 14:59:50 UTC (rev 618) +++ safekeep/trunk/TODO 2008-11-19 15:05:21 UTC (rev 619) @@ -4,7 +4,6 @@ * Add tests db dumps * Avoid snapshotting snapshots * Don't snapshot a device if a snapshot is already present - * Local backup to bypass ssh * Protect against multiple safekeep instance running at once * Run ssh/rdiff through nice so we can control the load better * Use -l with ssh to limit the bandwidth used during the backup @@ -17,8 +16,6 @@ http://dag.wieers.com/blog/content/call-for-participation-on-mksysb Future (post 1.0): - * Support more of rdiff-backup special file selectors - * Package it up for Ubuntu/Debian * Modify the test to not rely on Lattica's servers * Decide how big the snapshot size should be automagically * Fully automatic shapshotting mode Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 14:59:50 UTC (rev 618) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 15:05:21 UTC (rev 619) @@ -116,6 +116,8 @@ %doc sample.backup %changelog + - Do not compress the SSH traffic, it is handled by rdiff-backup + - Add SSH verbosity control - Fix dopey MySQL dump. * Tue Oct 7 2008 Dimi Paun <di...@la...> 1.0.5-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 16:37:29
|
Revision: 620 http://safekeep.svn.sourceforge.net/safekeep/?rev=620&view=rev Author: dimi Date: 2008-11-19 16:37:25 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Run ssh/rdiff through nice so we can control the load better on the server. Modified Paths: -------------- safekeep/trunk/TODO safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/TODO =================================================================== --- safekeep/trunk/TODO 2008-11-19 15:05:21 UTC (rev 619) +++ safekeep/trunk/TODO 2008-11-19 16:37:25 UTC (rev 620) @@ -5,7 +5,6 @@ * Avoid snapshotting snapshots * Don't snapshot a device if a snapshot is already present * Protect against multiple safekeep instance running at once - * Run ssh/rdiff through nice so we can control the load better * Use -l with ssh to limit the bandwidth used during the backup Feedback from users: Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 15:05:21 UTC (rev 619) +++ safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 16:37:25 UTC (rev 620) @@ -45,6 +45,14 @@ If not specified, `safekeep` will just use `/usr/sbin/sendmail` to deliver the mail. +nice.adjustment:: + The nice level adjustment for safekeep, for the time + being used only on the server side. + 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. + FILES ----- /etc/safekeep/safekeep.conf Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-11-19 15:05:21 UTC (rev 619) +++ safekeep/trunk/safekeep 2008-11-19 16:37:25 UTC (rev 620) @@ -706,9 +706,14 @@ else: log(line[:-1]) -def do_server_rdiff(cfg, bdir, force): - args = ['rdiff-backup'] +def do_server_rdiff(cfg, bdir, nice, force): + args = [] + if (nice) + args.extend(['nice', '-n' + nice]) + + args.extend(['rdiff-backup']) + if cfg['host']: schema = 'ssh %s -i %s %%s rdiff-backup --server' % (verbosity_ssh, cfg['key_data']) args.extend(['--remote-schema', schema]) @@ -772,7 +777,7 @@ elif server_minor > client_minor: warn('Protocol mismatch: %s <> %s' % (PROTOCOL, client_protocol)) -def do_server(cfgs, ids, force, cleanup): +def do_server(cfgs, ids, nice, force, cleanup): debug("Do server main loop") for cfg in cfgs.itervalues(): id = cfg['id'] @@ -842,7 +847,7 @@ else: backup_marker = None - do_server_rdiff(cfg, bdir, force) + do_server_rdiff(cfg, bdir, nice, force) errs = 0 if os.path.isdir(rdiff_logdir): @@ -1122,6 +1127,7 @@ keys_status = None keys_print = None keys_deploy = None + nice_srv = None for o, a in opts: if o in ('-c', '--conf'): if os.path.isdir(a) or a.endswith(config_ext): @@ -1229,6 +1235,10 @@ smtp = props['email.smtp.server'] if 'email.to' in props: email = props['email.to'].split(',') + if 'nice.adjustment' in props: + nice_srv = props['nice.adjustment'] + if (nice_srv) nice_srv = int(nice_srv) + if len(cfglocs) == 0: locs = os.path.join(os.path.dirname(cfgfile), 'backup.d') if os.path.isdir(locs): cfglocs.append(locs) @@ -1271,7 +1281,7 @@ if mode is 'server': is_client = False verbosity_level = 1 + verbosity - do_server(cfgs, args, force, cleanup) + do_server(cfgs, args, nice_srv, force, cleanup) elif mode is 'list': if list_type is None: list_type = 'increments' Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 15:05:21 UTC (rev 619) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 16:37:25 UTC (rev 620) @@ -116,6 +116,7 @@ %doc sample.backup %changelog + - Run ssh/rdiff through nice so we can control the load better on the server - Do not compress the SSH traffic, it is handled by rdiff-backup - Add SSH verbosity control - Fix dopey MySQL dump. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 16:39:59
|
Revision: 621 http://safekeep.svn.sourceforge.net/safekeep/?rev=621&view=rev Author: dimi Date: 2008-11-19 16:39:56 +0000 (Wed, 19 Nov 2008) Log Message: ----------- By default, run safekeep with nice +10 on the server side Modified Paths: -------------- safekeep/trunk/safekeep.conf safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2008-11-19 16:37:25 UTC (rev 620) +++ safekeep/trunk/safekeep.conf 2008-11-19 16:39:56 UTC (rev 621) @@ -10,6 +10,9 @@ # the base directory for data repository relative paths base.dir = /var/lib/safekeep +# by default, be nice to the server during backup +nice.adjustment = 10 + # a comma separated list of emails to receive the logs # email.to=pe...@co...,ro...@co... Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 16:37:25 UTC (rev 620) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 16:39:56 UTC (rev 621) @@ -116,6 +116,7 @@ %doc sample.backup %changelog + - By default, run safekeep with nice +10 on the server side - Run ssh/rdiff through nice so we can control the load better on the server - Do not compress the SSH traffic, it is handled by rdiff-backup - Add SSH verbosity control This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 18:17:02
|
Revision: 622 http://safekeep.svn.sourceforge.net/safekeep/?rev=622&view=rev Author: dimi Date: 2008-11-19 18:16:58 +0000 (Wed, 19 Nov 2008) Log Message: ----------- First cut at implementing bandwidth limiting based on trickle. Modified Paths: -------------- safekeep/trunk/TODO safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/TODO =================================================================== --- safekeep/trunk/TODO 2008-11-19 16:39:56 UTC (rev 621) +++ safekeep/trunk/TODO 2008-11-19 18:16:58 UTC (rev 622) @@ -5,7 +5,6 @@ * Avoid snapshotting snapshots * Don't snapshot a device if a snapshot is already present * Protect against multiple safekeep instance running at once - * Use -l with ssh to limit the bandwidth used during the backup Feedback from users: * Øyvind Skaar <os...@op...>: FreeBSD have snapshot capabilities Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-11-19 16:39:56 UTC (rev 621) +++ safekeep/trunk/safekeep 2008-11-19 18:16:58 UTC (rev 622) @@ -45,14 +45,17 @@ 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 = {} PROTOCOL = "1.1" VERSION = "1.0.5" @@ -99,7 +102,7 @@ if line.startswith(marker): marker = None continue - if (line.startswith("Errors ")): + if line.startswith("Errors "): errs = int(line[6:]) info(line.rstrip()) finally: @@ -118,6 +121,17 @@ def error(msg): log(msg, 'ERR') +def try_to_run(cmd): + cmd = cmd.split(' ')[0] + proc = popen2.Popen4(args) + proc.tochild.close() + for line in proc.fromchild: + info(line.rstrip()) + proc.fromchild.close() + rc = proc.wait() + + return os.WIFEXITED(rc) + def spawn(args): if isinstance(args, str) or isinstance(args, unicode): debug('Run [' + args + ']') @@ -239,6 +253,13 @@ 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_config(backup_el, dflt_id): if backup_el.tagName != 'backup': raise ConfigException('Invalid config file, the top level element must be <backup>') @@ -264,6 +285,13 @@ 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 a bandwidth element') + repo_el = backup_el.getElementsByTagName('repo') dir = None retention = None @@ -323,7 +351,7 @@ return { 'id': id, 'host' : host, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, - 'cludes' : cludes, 'options' : options} + 'cludes' : cludes, 'options' : options, 'bw': bw} def parse_locs(cfglocs): cfgfiles = [] @@ -709,13 +737,35 @@ def do_server_rdiff(cfg, bdir, nice, force): args = [] - if (nice) + if nice: args.extend(['nice', '-n' + nice]) args.extend(['rdiff-backup']) if cfg['host']: - schema = 'ssh %s -i %s %%s rdiff-backup --server' % (verbosity_ssh, cfg['key_data']) + 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 ' + limit_dl + if limit_ul: + trickle += ' -u ' + limit_ul + + if trickle: + if !try_to_run(trickle_cmd + ' -V'): + warn('Trickle not available, bandwidth limiting disabled') + trickle = '' + + schema = '% ssh %s -i %s %%s rdiff-backup --server' % (trickle, verbosity_ssh, cfg['key_data']) args.extend(['--remote-schema', schema]) if force: @@ -1227,6 +1277,13 @@ else: cfgfile = config_file props = {} + + def get_int(prop): + v = props.get(p) + if v is not None and v is not '': + return int(v) + return None + if 'backup.user' in props: backup_user = props['backup.user'] if 'base.dir' in props: @@ -1235,10 +1292,13 @@ smtp = props['email.smtp.server'] if 'email.to' in props: email = props['email.to'].split(',') - if 'nice.adjustment' in props: - nice_srv = props['nice.adjustment'] - if (nice_srv) nice_srv = int(nice_srv) + nice_srv = get_int('nice.adjustment') + global default_bandwidth + default_bandwidth['overall'] = get_int('bandwidth.limit') or 0 + default_bandwidth['download'] = get_int('bandwidth.limit.download') or 0 + default_bandwidth['upload'] = get_int('bandwidth.limit.upload') or 0 + if len(cfglocs) == 0: locs = os.path.join(os.path.dirname(cfgfile), 'backup.d') if os.path.isdir(locs): cfglocs.append(locs) @@ -1274,10 +1334,10 @@ if not ok: sys.exit(2) try: - global is_client, verbosity_level, verbosity_ssh + global is_client, verbosity_level, verbosity_ssh, verbosity_trickle if verbosity > 0: - verbosity_ssh = '-' + verbosity * 'v' + verbosity_trickle = verbosity_ssh = '-' + verbosity * 'v' if mode is 'server': is_client = False verbosity_level = 1 + verbosity Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 16:39:56 UTC (rev 621) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 18:16:58 UTC (rev 622) @@ -116,6 +116,7 @@ %doc sample.backup %changelog + - Implement bandwidth limiting, based on trickle - By default, run safekeep with nice +10 on the server side - Run ssh/rdiff through nice so we can control the load better on the server - Do not compress the SSH traffic, it is handled by rdiff-backup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 18:40:08
|
Revision: 623 http://safekeep.svn.sourceforge.net/safekeep/?rev=623&view=rev Author: dimi Date: 2008-11-19 18:40:03 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Add pass-through options for the DB dump command Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 18:16:58 UTC (rev 622) +++ safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 18:40:03 UTC (rev 623) @@ -46,8 +46,9 @@ Databases can be dumped individualy using a dump clause for each database. --> <dump type="postgres" - db="dbname" + db="my_db" dbuser="foobar" + options="--schema=public" file="/var/backup/dumps/mydata" cleanup="true" /> @@ -182,6 +183,13 @@ This is currently supported only for MySQL databases. Optional, it has no default value. +/backup/setup/dump/@options:: + Extra options to be passed along to the dump command. + This is database specific, and it is passed along as-is. + Please refer to your database documentation for possible + values that you can pass along. + Optional, it has no default value. + /backup/setup/dump/@user:: The system user under which the dump should take place. Please note that using this feature requires that `safekeep(1)` Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-11-19 18:16:58 UTC (rev 622) +++ safekeep/trunk/safekeep 2008-11-19 18:40:03 UTC (rev 623) @@ -225,12 +225,14 @@ 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, - 'file' : file, 'cleanup' : cleanup } + 'opts' : opts, 'file' : file, 'cleanup' : cleanup } def parse_snap(snap_el): device = snap_el.getAttribute('device') @@ -400,6 +402,7 @@ debug('Doing DB dumps') for dump in cfg['dumps']: type = dump['type'] + opts = dump['opts'] if type in ('postgres', 'postgresql', 'pgsql'): if dump['db']: args = ['pg_dump'] @@ -408,6 +411,7 @@ args = ['pg_dumpall'] if dump['dbuser']: args.extend(['-U', dump['dbuser']]) + args.extend(opts) if dump['db']: args.append(dump['db']) elif type in ('mysql'): @@ -416,10 +420,11 @@ args.extend(['-u' + dump['dbuser']]) if dump['dbpasswd']: args.extend(['-p' + dump['dbpasswd']]) + if not dump['db']: + args.append('-A') + args.extend(opts) if dump['db']: args.append(dump['db']) - else: - args.append('-A') else: warn('Invalid database type: ' + type) continue Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 18:16:58 UTC (rev 622) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 18:40:03 UTC (rev 623) @@ -116,6 +116,7 @@ %doc sample.backup %changelog + - Add pass-through options for the DB dump command - Implement bandwidth limiting, based on trickle - By default, run safekeep with nice +10 on the server side - Run ssh/rdiff through nice so we can control the load better on the server This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 19:06:02
|
Revision: 624 http://safekeep.svn.sourceforge.net/safekeep/?rev=624&view=rev Author: dimi Date: 2008-11-19 19:05:57 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Allow passing the pgpasswd to PostgreSQL as well. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 18:40:03 UTC (rev 623) +++ safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 19:05:57 UTC (rev 624) @@ -179,8 +179,10 @@ based on the system user. /backup/setup/dump/@dbpasswd:: - Password of the database user to use while doing the dump. - This is currently supported only for MySQL databases. + Password of the database user to use while doing the dump. + NB: this makes the DB password available in a plain text file. + Make sure you use appropriate read permissions on the backup + configuration file to prevent unauthorized access to the password. Optional, it has no default value. /backup/setup/dump/@options:: Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2008-11-19 18:40:03 UTC (rev 623) +++ safekeep/trunk/safekeep 2008-11-19 19:05:57 UTC (rev 624) @@ -403,6 +403,7 @@ 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'] @@ -414,6 +415,12 @@ args.extend(opts) if dump['db']: args.append(dump['db']) + if dump['dbpasswd']: + (fd, passwdfile) = tempfile.mkstemp() + f = file(fd) + f.write(dump['dbpasswd']) + f.close() + elif type in ('mysql'): args = ['mysqldump'] if dump['dbuser']: @@ -425,15 +432,26 @@ args.extend(opts) if dump['db']: args.append(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'])) - ec = spawn(cmd) + + + if passwdfile: + 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: ' + dump['db']) Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2008-11-19 18:40:03 UTC (rev 623) +++ safekeep/trunk/safekeep.spec.in 2008-11-19 19:05:57 UTC (rev 624) @@ -116,6 +116,7 @@ %doc sample.backup %changelog + - Allow passing the pgpasswd to PostgreSQL as well - Add pass-through options for the DB dump command - Implement bandwidth limiting, based on trickle - By default, run safekeep with nice +10 on the server side This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-11-19 20:42:42
|
Revision: 628 http://safekeep.svn.sourceforge.net/safekeep/?rev=628&view=rev Author: dimi Date: 2008-11-19 20:42:39 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Document the new bandwidth limiting feature. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep.conf Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 19:33:33 UTC (rev 627) +++ safekeep/trunk/doc/safekeep.backup.txt 2008-11-19 20:42:39 UTC (rev 628) @@ -30,6 +30,10 @@ key-data="/home/jdoe/.ssh/backup2_id_dsa" /> + <!-- you can customize the bandwidth limit on a client basis, + for example to 50KB/s download/upload --> + <bandwidth overall="80" download="50" upload="50" /> + <!-- 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"/> @@ -118,6 +122,23 @@ is recommended. Optional, defaults to `~/.ssh/safekeep-server-data-key`. +/backup/bandwidth/@overall:: + This is the client bandwidth limit for both upload and download. + It is an integer number of KB/s (see the NOTES section in + `safekeep.conf(5)` for more information). + Optional, overrides `bandwidth.overall` in `safekeep.conf(5)` + if specified. + +/backup/bandwidth/@download:: + This is the client bandwidth limit for download (see + `/backup/bandwidth/@overall` for more information). + Optional, overrides `/backup/bandwidth/@overall` if specified. + +/backup/bandwidth/@upload:: + This is the client bandwidth limit for upload (see + `/backup/bandwidth/@overall` for more information). + Optional, overrides `/backup/bandwidth/@overall` if specified. + /backup/repo/@path:: The path under which the backups will be stored. Relative paths are based on the 'base.dir' setting from the 'safekeep.conf(5)'. @@ -292,5 +313,5 @@ SEE ALSO -------- -safekeep(1), rdiff-backup(1), lvcreate(8) +safekeep(1), safekeep.conf(5), rdiff-backup(1), lvcreate(8) Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 19:33:33 UTC (rev 627) +++ safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 20:42:39 UTC (rev 628) @@ -53,11 +53,44 @@ to 19 (least favorable). If no nice level is specified, safekeep is not niced. +bandwidth.overall:: + This is the default bandwidth limit for both upload and + download for all the clients. It is an integer number of KB/s + (see NOTES section for more information). + This value is optional. + +bandwidth.download:: + This is the default bandwidth limit for download across all clients. + If specified (with a value greater than 0) it will override + the value set in `bandwidth.overall` (refer to it for more + informatio). This value is optional. + +bandwidth.upload:: + This is the default bandwidth limit for upload across all clients. + If specified (with a value greater than 0) it will override + the value set in `bandwidth.overall` (refer to it for more + informatio). This value is optional. + +NOTES +----- +Safekeep uses `trickle` to implement bandwidth throttling (see +http://monkey.org/~marius/pages/?page=trickle for more information). +You will need to install it separately to use this feature (most +Linux distributions have it packaged as `trickle`). + +The bandwidth is calculated as an average over a 256KB window, +and it is expressed as an integer number of kilo-bytes per second +(e.g. 100, meaning 100KB/s). Bandwidth limits of zero are ignored. + +The bandwidth throtlling can be customized for both download and upload +(see `bandwidth.download` and `bandwidth.upload`) as well as on a per-client +basis (see `safekeep.backup(5)` for more information). + FILES ----- /etc/safekeep/safekeep.conf SEE ALSO -------- -safekeep(1), safekeep.backup(5), rdiff-backup(1), lvcreate(8) +safekeep(1), safekeep.backup(5), rdiff-backup(1), trickle(1), lvcreate(8) Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2008-11-19 19:33:33 UTC (rev 627) +++ safekeep/trunk/safekeep.conf 2008-11-19 20:42:39 UTC (rev 628) @@ -13,6 +13,15 @@ # by default, be nice to the server during backup nice.adjustment = 10 +# A default bandwidth limit for both download/upload +# bandwidth.overall=100 + +# A default bandwidth limit for download +# bandwidth.download=100 + +# A default bandwidth limit for upload +# bandwidth.upload=100 + # 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...> - 2009-03-14 21:14:11
|
Revision: 633 http://safekeep.svn.sourceforge.net/safekeep/?rev=633&view=rev Author: dimi Date: 2009-03-14 21:14:03 +0000 (Sat, 14 Mar 2009) Log Message: ----------- Frank Crawford <fr...@cr...> Implements the discussion of invoking an external script on the client side, during a backup being run. Modified Paths: -------------- safekeep/trunk/debian/safekeep-common.docs safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in safekeep/trunk/sample.backup Added Paths: ----------- safekeep/trunk/doc/client-script-sample.sh Modified: safekeep/trunk/debian/safekeep-common.docs =================================================================== --- safekeep/trunk/debian/safekeep-common.docs 2009-03-01 06:17:14 UTC (rev 632) +++ safekeep/trunk/debian/safekeep-common.docs 2009-03-14 21:14:03 UTC (rev 633) @@ -3,3 +3,4 @@ LICENSE README TODO +client-script-sample.sh Added: safekeep/trunk/doc/client-script-sample.sh =================================================================== --- safekeep/trunk/doc/client-script-sample.sh (rev 0) +++ safekeep/trunk/doc/client-script-sample.sh 2009-03-14 21:14:03 UTC (rev 633) @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Safekeep client script +# API: $1 = Step, $2 = Safekeep ID, $3 = Backup Root Directory +# +# Sample script, please configure as appropriate for your site. +# +# Note: output from this script is normally only seen in debug mode. +# + +case $1 in +'STARTUP') mail -s "Safekeep Backup: Started $2" root < /dev/null ;; +'PRE-SETUP') ;; +'POST-SETUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; +'POST-BACKUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; +'POST-SCRUB') ;; +esac + +exit 0 Property changes on: safekeep/trunk/doc/client-script-sample.sh ___________________________________________________________________ Added: svn:executable + * Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2009-03-01 06:17:14 UTC (rev 632) +++ safekeep/trunk/doc/safekeep.backup.txt 2009-03-14 21:14:03 UTC (rev 633) @@ -64,6 +64,13 @@ size="500M" /> + <!-- location of a script to be executed on the client at different + stages of the run. It is called with three arguments: + the step of the backup, backup id and the backup root directory --> + <script + path="/path/to/script" + /> + </setup> <!-- data to be backup --> @@ -250,6 +257,16 @@ of the original device's size. Mandatory for a `<snapshot>` element. +/backup/setup/script/@path:: + Execute the script specified path on the client at certain steps + of the backup process. + This script is executed with three arguments: + - Backup id (/backup/@id) + - Backup step + - Backup root directory (valid after creation of a snapshot) + See the `CLIENT SCRIPT` section for more information. + Mandatory for a `<script>` 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 @@ -306,7 +323,47 @@ For more information on file selection semantics, please see `rdiff-backup(1)`. +CLIENT SCRIPT +------------- +`safekeep(1)` support the optional execution of a script or program +on the client system at different steps during execution of the backup. +Note: specification of a script which does not exist is not considered an +error, and is treated as the same as not specifying a script. However, if +the specified path does match a file or directory, the security tests listed +below will occur. + +This script is executed with the following three arguments: +- Safekeep step +- Backup id +- Backup root directory, which may be set during the creation of a snapshot. + +The steps currently defined and tokens passed, are: +- STARTUP - prior to any execution, however, if it exits with a non-zero +status this constitues an error and the backup is aborted. +- PRE-SETUP - prior to running any setup steps being run. A non-zero status +is considered a warning and execution continues. +- POST-SETUP - after setup, but prior to execution of backup. A non-zero +status is considered a warning, and execution continues. +- POST-BACKUP - after execution of backup. A non-zero status is considered +a warning, and execution continues. +- POST-SCRUB - after execution of a server cleanup step, normally only seen +after a backup failure. A non-zero status is considered a warning, and +execution continues. + +Due to security considerations, there are a number of checks made on this +script prior to execution and failure of any of these steps will cause the +backup for that client to be aborted. The following tests are applied prior +to each execution of the script (i.e. multiple time per backup), in order: +- script is a regular file, not a directory or special file, +- script is executable by the user running on the client system, +- script is owned by root or the user running on the client system, +- script is NOT writable by any one except the script owner. + +Note: no test is made on the ownership of the parent directory or any other +directories. + + FILES ----- /etc/safekeep/backup.d/ Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2009-03-01 06:17:14 UTC (rev 632) +++ safekeep/trunk/safekeep 2009-03-14 21:14:03 UTC (rev 633) @@ -16,7 +16,7 @@ # along with Safekeep. If not, see <http://www.gnu.org/licenses/>. from __future__ import generators -import getopt, os, os.path, popen2, re, sys, fnmatch +import getopt, os, os.path, popen2, re, sys, fnmatch, stat import commands, tempfile, time, traceback import getpass, pwd, xml.dom.minidom import socket, smtplib @@ -325,6 +325,7 @@ 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: @@ -332,6 +333,11 @@ 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_el = backup_el.getElementsByTagName('data') @@ -353,7 +359,7 @@ cludes = [{ 'type' : 'exclude', 'path' : path, 'glob' : None, 'regexp' : None } for path in path_xcludes] return { 'id': id, 'host' : host, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, - 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, + 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, 'script' : script, 'cludes' : cludes, 'options' : options, 'bw': bw} def parse_locs(cfglocs): @@ -394,11 +400,43 @@ return cfgs ###################################################################### -# DB and SNAPSHOT support +# 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']: @@ -715,21 +753,29 @@ try: line = sys.stdin.readline() if line.startswith('ALOHA'): - do_client_compat(line.split(':', 1)[1]) + do_client_compat(line.strip().split(':', 1)[1]) send('OK %s, %s' % (PROTOCOL, VERSION)) elif line.startswith('CONFIG'): cfg = do_client_config(line) - send('OK') + 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 @@ -1362,8 +1408,8 @@ try: global is_client, verbosity_level, verbosity_ssh, verbosity_trickle - if verbosity > 0: - verbosity_trickle = verbosity_ssh = '-' + verbosity * 'v' + if verbosity > 2: + verbosity_trickle = verbosity_ssh = '-' + (verbosity-2) * 'v' if mode is 'server': is_client = False verbosity_level = 1 + verbosity Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2009-03-01 06:17:14 UTC (rev 632) +++ safekeep/trunk/safekeep.spec.in 2009-03-14 21:14:03 UTC (rev 633) @@ -98,7 +98,7 @@ %defattr(-,root,root,-) %{_bindir}/safekeep %{_mandir}/man1/safekeep.1* -%doc AUTHORS COPYING LICENSE README TODO +%doc AUTHORS COPYING LICENSE README TODO client-script-sample.sh %files client %defattr(-,root,root,-) Modified: safekeep/trunk/sample.backup =================================================================== --- safekeep/trunk/sample.backup 2009-03-01 06:17:14 UTC (rev 632) +++ safekeep/trunk/sample.backup 2009-03-14 21:14:03 UTC (rev 633) @@ -37,6 +37,12 @@ size="500M" /> + <!-- location of a script to be executed on the client at different + stages of the run. It is called with three arguments: + the step of the backup, backup id and the backup root directory --> + <script + path="/path/to/script" + /> </setup> <!-- data to be backuped --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2009-03-15 14:50:53
|
Revision: 635 http://safekeep.svn.sourceforge.net/safekeep/?rev=635&view=rev Author: dimi Date: 2009-03-15 14:50:38 +0000 (Sun, 15 Mar 2009) Log Message: ----------- Move the samples to a separate directory. Modified Paths: -------------- safekeep/trunk/safekeep.spec.in Added Paths: ----------- safekeep/trunk/samples/ safekeep/trunk/samples/client-script-sample.sh safekeep/trunk/samples/sample.backup Removed Paths: ------------- safekeep/trunk/doc/client-script-sample.sh safekeep/trunk/sample.backup Deleted: safekeep/trunk/doc/client-script-sample.sh =================================================================== --- safekeep/trunk/doc/client-script-sample.sh 2009-03-14 21:17:23 UTC (rev 634) +++ safekeep/trunk/doc/client-script-sample.sh 2009-03-15 14:50:38 UTC (rev 635) @@ -1,19 +0,0 @@ -#! /bin/sh -# -# Safekeep client script -# API: $1 = Step, $2 = Safekeep ID, $3 = Backup Root Directory -# -# Sample script, please configure as appropriate for your site. -# -# Note: output from this script is normally only seen in debug mode. -# - -case $1 in -'STARTUP') mail -s "Safekeep Backup: Started $2" root < /dev/null ;; -'PRE-SETUP') ;; -'POST-SETUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; -'POST-BACKUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; -'POST-SCRUB') ;; -esac - -exit 0 Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2009-03-14 21:17:23 UTC (rev 634) +++ safekeep/trunk/safekeep.spec.in 2009-03-15 14:50:38 UTC (rev 635) @@ -98,7 +98,7 @@ %defattr(-,root,root,-) %{_bindir}/safekeep %{_mandir}/man1/safekeep.1* -%doc AUTHORS COPYING LICENSE README TODO client-script-sample.sh +%doc AUTHORS COPYING LICENSE README TODO samples/client-script-sample.sh %files client %defattr(-,root,root,-) @@ -113,9 +113,10 @@ %{_sysconfdir}/cron.daily/safekeep %{_mandir}/man5/safekeep.conf.5* %{_mandir}/man5/safekeep.backup.5* -%doc sample.backup +%doc samples/sample.backup %changelog + - Move the samples to a separate directory - Add a few trigger points where external scripts can be executed - Less verbosity from external helpers when invoked with -v - Avoid errors when dealing with mounts containing spaces. Deleted: safekeep/trunk/sample.backup =================================================================== --- safekeep/trunk/sample.backup 2009-03-14 21:17:23 UTC (rev 634) +++ safekeep/trunk/sample.backup 2009-03-15 14:50:38 UTC (rev 635) @@ -1,61 +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" - /> - - <!-- location of a script to be executed on the client at different - stages of the run. It is called with three arguments: - the step of the backup, backup id and the backup root directory --> - <script - path="/path/to/script" - /> - </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> Copied: safekeep/trunk/samples/client-script-sample.sh (from rev 633, safekeep/trunk/doc/client-script-sample.sh) =================================================================== --- safekeep/trunk/samples/client-script-sample.sh (rev 0) +++ safekeep/trunk/samples/client-script-sample.sh 2009-03-15 14:50:38 UTC (rev 635) @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Safekeep client script +# API: $1 = Step, $2 = Safekeep ID, $3 = Backup Root Directory +# +# Sample script, please configure as appropriate for your site. +# +# Note: output from this script is normally only seen in debug mode. +# + +case $1 in +'STARTUP') mail -s "Safekeep Backup: Started $2" root < /dev/null ;; +'PRE-SETUP') ;; +'POST-SETUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; +'POST-BACKUP') /etc/init.d/autofs condrestart 2>&1 | mail -s "Safekeep Backup: $1 $2" root ;; +'POST-SCRUB') ;; +esac + +exit 0 Copied: safekeep/trunk/samples/sample.backup (from rev 633, safekeep/trunk/sample.backup) =================================================================== --- safekeep/trunk/samples/sample.backup (rev 0) +++ safekeep/trunk/samples/sample.backup 2009-03-15 14:50:38 UTC (rev 635) @@ -0,0 +1,61 @@ +<!-- 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" + /> + + <!-- location of a script to be executed on the client at different + stages of the run. It is called with three arguments: + the step of the backup, backup id and the backup root directory --> + <script + path="/path/to/script" + /> + </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...> - 2009-03-16 15:05:28
|
Revision: 637 http://safekeep.svn.sourceforge.net/safekeep/?rev=637&view=rev Author: dimi Date: 2009-03-16 15:05:14 +0000 (Mon, 16 Mar 2009) Log Message: ----------- Frank Crawford <fr...@cr...> Rework the handling of device files, fifos and sockets as data attributes. Now special files are by default included, unless explicitely excluded. A bunch of spelling fixes sprinkled throughout. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep safekeep/trunk/samples/sample.backup Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2009-03-15 14:52:52 UTC (rev 636) +++ safekeep/trunk/doc/safekeep.backup.txt 2009-03-16 15:05:14 UTC (rev 637) @@ -38,16 +38,12 @@ and for how long (D=days, W=weeks, M=months, or Y=years) --> <repo path="./data" retention="10D"/> - <options> - <special-files include="false" /> - </options> - <!-- settings for database dump and for volume snapshot --> <setup> <!-- database type ("postgres" or "mysql"), and database name, DB 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. - Databases can be dumped individualy using a dump clause for each database. --> + Databases can be dumped individually using a dump clause for each database. --> <dump type="postgres" db="my_db" @@ -74,7 +70,7 @@ </setup> <!-- data to be backup --> - <data> + <data exclude-fifos="true" exclude-sockets="true"> <!-- 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"/> @@ -156,7 +152,7 @@ will fail altogether if the directory can not be created. Optional, defaults to the client ID, see `/backup/@id`. Use of the default value is *highly* recommended. - *NOTE*: if you must set this value explicitely, you must + *NOTE*: if you must set this value explicitly, you must make sure that the path is not shared between different boxes; a shared repository path _will_ result in data loss. @@ -179,11 +175,12 @@ Optional, defaults to empty (unlimited retention). /backup/options/special-files/@include:: + NOTE: THIS OPTION HAS BEEN DEPRECATED. See data attributes below. One of "true" or "false". If "true", the dump file will include all special files, including device files, fifo files and socket files. Optional, defaults to "false". - *NOTE*: specification of no options is equalent to false, but the + *NOTE*: specification of no options is equivalent to false, but the inclusion of other options may cause the underlying backup defaults to be use. @@ -267,6 +264,30 @@ See the `CLIENT SCRIPT` section for more information. Mandatory for a `<script>` element. +/backup/data/@exclude-devices:: + One of "true" or "false". If "true", the dump file will + exclude all device files. + Optional, defaults to "false". + *NOTE*: specification of no attributes is equivalent to false, but the + inclusion of other options may cause the underlying backup defaults + to be use. + +/backup/data/@exclude-fifos:: + One of "true" or "false". If "true", the dump file will + exclude all fifos. + Optional, defaults to "false". + *NOTE*: specification of no attributes is equivalent to false, but the + inclusion of other options may cause the underlying backup defaults + to be use. + +/backup/data/@exclude-sockets:: + One of "true" or "false". If "true", the dump file will + exclude all sockets. + Optional, defaults to "false". + *NOTE*: specification of no attribute is equivalent to false, but the + inclusion of other options may cause the underlying backup defaults + to be use. + /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 @@ -314,7 +335,7 @@ 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 +or excluded respectively; 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 @@ -340,7 +361,7 @@ The steps currently defined and tokens passed, are: - STARTUP - prior to any execution, however, if it exits with a non-zero -status this constitues an error and the backup is aborted. +status this constitutes an error and the backup is aborted. - PRE-SETUP - prior to running any setup steps being run. A non-zero status is considered a warning and execution continues. - POST-SETUP - after setup, but prior to execution of backup. A non-zero Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2009-03-15 14:52:52 UTC (rev 636) +++ safekeep/trunk/safekeep 2009-03-16 15:05:14 UTC (rev 637) @@ -263,6 +263,13 @@ '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>') @@ -293,7 +300,7 @@ if len(bw_el) == 1: bw = parse_bandwidth(bw_el[0]) elif len(bw_el) > 1: - raise ConfigException('Can not have more than a bandwidth element') + raise ConfigException('Can not have more than one bandwidth element') repo_el = backup_el.getElementsByTagName('repo') dir = None @@ -302,7 +309,7 @@ dir = repo_el[0].getAttribute('path') retention = repo_el[0].getAttribute('retention') elif len(repo_el) > 1: - raise ConfigException('Can not have more than a repo element') + raise ConfigException('Can not have more than one repo element') if not dir: dir = id dir = os.path.join(base_dir, dir) @@ -313,6 +320,8 @@ 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(): @@ -339,9 +348,11 @@ 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 data_el: + 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: @@ -351,6 +362,8 @@ 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', @@ -360,7 +373,7 @@ return { 'id': id, 'host' : host, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, 'dir' : dir, 'retention' : retention, 'dumps' : dumps, 'snaps' : snaps, 'script' : script, - 'cludes' : cludes, 'options' : options, 'bw': bw} + 'cludes' : cludes, 'data_options' : data_options, 'options' : options, 'bw' : bw} def parse_locs(cfglocs): cfgfiles = [] @@ -497,7 +510,7 @@ def do_client_dbdump_teardown(cfg): debug('Tear down DB dumps') for dump in cfg['dumps']: - if dump['cleanup'] != 'true': + if dump['cleanup'].lower() != 'true': continue try: os.remove(dump['file']) @@ -844,7 +857,15 @@ args.extend(['--force']) options_append = [] - special_files = ['--exclude-device-files', '--exclude-sockets', '--exclude-fifos'] + + 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']: Modified: safekeep/trunk/samples/sample.backup =================================================================== --- safekeep/trunk/samples/sample.backup 2009-03-15 14:52:52 UTC (rev 636) +++ safekeep/trunk/samples/sample.backup 2009-03-16 15:05:14 UTC (rev 637) @@ -9,7 +9,7 @@ key-data="/home/jdoe/.ssh/backup2_id_dsa" /> - <!-- location where the backuped data will be stored on the server + <!-- location where the backed up 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" @@ -45,8 +45,8 @@ /> </setup> - <!-- data to be backuped --> - <data> + <!-- data to be backed up --> + <data exclude-fifos="true" exclude-sockets="true"> <!-- 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"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2009-03-30 06:01:23
|
Revision: 639 http://safekeep.svn.sourceforge.net/safekeep/?rev=639&view=rev Author: dimi Date: 2009-03-30 06:01:13 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Pre release Modified Paths: -------------- safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2009-03-16 15:05:43 UTC (rev 638) +++ safekeep/trunk/safekeep 2009-03-30 06:01:13 UTC (rev 639) @@ -58,7 +58,7 @@ default_bandwidth = {} PROTOCOL = "1.1" -VERSION = "1.0.5" +VERSION = "1.2.0" VEBOSITY_BY_CLASS = {'DBG': 3, 'INFO': 2, 'WARN': 1, 'ERR': 0} ###################################################################### Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2009-03-16 15:05:43 UTC (rev 638) +++ safekeep/trunk/safekeep.spec.in 2009-03-30 06:01:13 UTC (rev 639) @@ -116,6 +116,7 @@ %doc samples/sample.backup %changelog +* Mon Mar 30 2009 Dimi Paun <di...@la...> 1.2.0-1 - Rework the handling of device files, fifos and sockets as data attributes. - Now special files are by default included, unless explicitely excluded. - A bunch of spelling fixes sprinkled throughout. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-19 06:55:31
|
Revision: 676 http://safekeep.svn.sourceforge.net/safekeep/?rev=676&view=rev Author: dimi Date: 2010-11-19 06:55:25 +0000 (Fri, 19 Nov 2010) Log Message: ----------- Add precise control of nice values for both server and client side of things. By default, safekeep will run now as nice +10 on both sides. However, existing installs will have to redeploy keys to get this running on the client side. Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.conf safekeep/trunk/samples/sample.backup Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2010-11-19 05:58:45 UTC (rev 675) +++ safekeep/trunk/doc/safekeep.backup.txt 2010-11-19 06:55:25 UTC (rev 676) @@ -25,7 +25,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" /> @@ -113,6 +113,12 @@ so it most likely needs to be 'root'. Optional, defaults to 'root'. +/backup/host/@nice:: + 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. + /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 Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 05:58:45 UTC (rev 675) +++ safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 06:55:25 UTC (rev 676) @@ -46,13 +46,23 @@ `/usr/sbin/sendmail` to deliver the mail. nice.adjustment:: - 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. +nice.adjustment.server:: + The nice level adjustment for safekeep, used on the server side. + It overrides the generic setting in nice.adjustment. + +nice.adjustment.client:: + 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. + bandwidth.overall:: This is the default bandwidth limit for both upload and download for all the clients. It is an integer number of KB/s Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-19 05:58:45 UTC (rev 675) +++ safekeep/trunk/safekeep 2010-11-19 06:55:25 UTC (rev 676) @@ -282,6 +282,7 @@ 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: @@ -373,7 +374,7 @@ '/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, 'user' : user, 'key_ctrl' : key_ctrl, 'key_data' : key_data, + 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} @@ -1060,7 +1061,7 @@ info('------------------------------------------------------------------') debug('Server listing done') -def do_keys(cfgs, ids, identity, status, dump, deploy): +def do_keys(cfgs, ids, nice_rem, identity, status, dump, deploy): for cfg in cfgs.itervalues(): id = cfg['id'] if ids and id not in ids: continue @@ -1068,6 +1069,13 @@ if not cfg['host']: info('%s: Client is local, it needs no keys' % id) continue + + nice = cfg['nice'] or nice_rem + if nice: + nice_cmd = 'nice -n%s' % (nice) + else: + nice_cmd = '' + cmds = ['safekeep --client', 'rdiff-backup --server --restrict-read-only /'] privatekeyfiles = [cfg.get('key_ctrl'), cfg.get('key_data')] lines = [] @@ -1099,7 +1107,7 @@ fin = open(publickeyfile, 'r') publickey = fin.read() fin.close() - line = 'command="%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s' % (cmd, publickey.strip()) + line = 'command="%s%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s' % (nice_cmd, cmd, publickey.strip()) lines.append(line) else: keys_ok = True @@ -1386,7 +1394,9 @@ smtp = props['email.smtp.server'] if 'email.to' in props: email = props['email.to'].split(',') - nice_srv = get_int('nice.adjustment') + nice_def = get_int('nice.adjustment') + nice_srv = get_int('nice.adjustment.server') or nice_def + nice_cln = get_int('nice.adjustment.client') or nice_def global default_bandwidth default_bandwidth['overall'] = get_int('bandwidth.limit') or 0 @@ -1456,7 +1466,7 @@ verbosity_level = 1 + verbosity if not keys_status and not keys_print and not keys_deploy: keys_status = True - do_keys(cfgs, args, identity, keys_status, keys_print, keys_deploy) + do_keys(cfgs, args, nice_cln, identity, keys_status, keys_print, keys_deploy) else: assert False, 'Unknown mode: %s' % (mode) except Exception, ex: Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2010-11-19 05:58:45 UTC (rev 675) +++ safekeep/trunk/safekeep.conf 2010-11-19 06:55:25 UTC (rev 676) @@ -10,7 +10,10 @@ # the base directory for data repository relative paths base.dir = /var/lib/safekeep -# by default, be nice to the server during backup +# by default, be nice during backup +# you can control the server/client nice level via +# nice.adjustment.server and nice.adjustment.client +# or even on a per-client box in the .backup file. nice.adjustment = 10 # A default bandwidth limit for both download/upload Modified: safekeep/trunk/samples/sample.backup =================================================================== --- safekeep/trunk/samples/sample.backup 2010-11-19 05:58:45 UTC (rev 675) +++ safekeep/trunk/samples/sample.backup 2010-11-19 06:55:25 UTC (rev 676) @@ -4,7 +4,7 @@ <!-- 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" + name="my_box.corp.com" user="root" nice="10" key-ctrl="/home/jdoe/.ssh/backup_id_dsa" key-data="/home/jdoe/.ssh/backup2_id_dsa" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-19 07:14:37
|
Revision: 678 http://safekeep.svn.sourceforge.net/safekeep/?rev=678&view=rev Author: dimi Date: 2010-11-19 07:14:31 +0000 (Fri, 19 Nov 2010) Log Message: ----------- Prep release Modified Paths: -------------- safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-19 07:02:19 UTC (rev 677) +++ safekeep/trunk/safekeep 2010-11-19 07:14:31 UTC (rev 678) @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2006-2007 Lattica, Inc. +# 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 @@ -44,7 +44,7 @@ cmd = "<Missing>" PROTOCOL = "1.1" -VERSION = "1.2.1" +VERSION = "1.3.0" VEBOSITY_BY_CLASS = {'DBG': 3, 'INFO': 2, 'WARN': 1, 'ERR': 0} ###################################################################### Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2010-11-19 07:02:19 UTC (rev 677) +++ safekeep/trunk/safekeep.spec.in 2010-11-19 07:14:31 UTC (rev 678) @@ -24,7 +24,7 @@ Summary: The SafeKeep backup system (common component) Group: Applications/System Requires: rdiff-backup -Requires: python >= 2.2 +Requires: python >= 2.4 %description common SafeKeep is a client/server backup system which enhances the @@ -116,6 +116,16 @@ %doc samples/sample.backup %changelog +* Fri Nov 19 2010 Dimi Paun <di...@la...> 1.3.0-1 + - 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 + - Drop support for Python < 2.4, subprocess module isn't supported. + - Multiple internal cleanups, and minor bugs fixes. + * Thu Apr 30 2009 Dimi Paun <di...@la...> 1.2.1-1 - Fix error while trying to nice the server This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-19 07:24:59
|
Revision: 679 http://safekeep.svn.sourceforge.net/safekeep/?rev=679&view=rev Author: dimi Date: 2010-11-19 07:24:53 +0000 (Fri, 19 Nov 2010) Log Message: ----------- Work around for udev bug https://bugzilla.redhat.com/show_bug.cgi?id=577798 Modified Paths: -------------- safekeep/trunk/safekeep safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-19 07:14:31 UTC (rev 678) +++ safekeep/trunk/safekeep 2010-11-19 07:24:53 UTC (rev 679) @@ -615,7 +615,13 @@ ret = spawn(['umount', snapmnt]) if ret: warn('Can not umount the snapshot: %s' % snapmnt) - ret = spawn(['lvremove', '--force', snapdev]) + + # 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) Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2010-11-19 07:14:31 UTC (rev 678) +++ safekeep/trunk/safekeep.spec.in 2010-11-19 07:24:53 UTC (rev 679) @@ -124,6 +124,8 @@ - Fix a bug when dumping a specific Postgresql database. - Prepare the code for newer Python versions - Drop support for Python < 2.4, subprocess module isn't supported. + - 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. * Thu Apr 30 2009 Dimi Paun <di...@la...> 1.2.1-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-19 22:05:13
|
Revision: 703 http://safekeep.svn.sourceforge.net/safekeep/?rev=703&view=rev Author: dimi Date: 2010-11-19 22:05:07 +0000 (Fri, 19 Nov 2010) Log Message: ----------- By default, run safekeep as niced Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 19:16:25 UTC (rev 702) +++ safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 22:05:07 UTC (rev 703) @@ -50,7 +50,8 @@ 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. nice.adjustment.server:: The nice level adjustment for safekeep, used on the server side. Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-19 19:16:25 UTC (rev 702) +++ safekeep/trunk/safekeep 2010-11-19 22:05:07 UTC (rev 703) @@ -1438,6 +1438,7 @@ if 'email.to' in props: email = props['email.to'].split(',') nice_def = get_int('nice.adjustment') + 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 Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2010-11-19 19:16:25 UTC (rev 702) +++ safekeep/trunk/safekeep.conf 2010-11-19 22:05:07 UTC (rev 703) @@ -14,7 +14,8 @@ # you can control the server/client nice level via # nice.adjustment.server and nice.adjustment.client # or even on a per-client box in the .backup file. -nice.adjustment = 10 +# to disable nice, set it to 0 +# nice.adjustment = 10 # A default bandwidth limit for both download/upload # bandwidth.limit=100 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2010-11-21 19:09:19
|
Revision: 704 http://safekeep.svn.sourceforge.net/safekeep/?rev=704&view=rev Author: dimi Date: 2010-11-21 19:09:13 +0000 (Sun, 21 Nov 2010) Log Message: ----------- Add support for ionice(1) Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 22:05:07 UTC (rev 703) +++ safekeep/trunk/doc/safekeep.conf.txt 2010-11-21 19:09:13 UTC (rev 704) @@ -64,6 +64,17 @@ the .backup file (see /backup/host/@nice). NB: if you change this value, you will have to re-deploy the auth keys. +ionice.adjustment:: + The default IO nice level adjustment for safekeep. + It can be either 'none', 'idle', 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 'ionice(1)' 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 'idle'. + bandwidth.overall:: This is the default bandwidth limit for both upload and download for all the clients. It is an integer number of KB/s Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2010-11-19 22:05:07 UTC (rev 703) +++ safekeep/trunk/safekeep 2010-11-21 19:09:13 UTC (rev 704) @@ -867,12 +867,18 @@ else: log(line[:-1]) -def do_server_rdiff(cfg, bdir, nice, force): +def do_server_rdiff(cfg, bdir, nice, ionice, force): args = [] if nice: args.extend(['nice', '-n' + str(nice)]) + if ionice and ionice != 'none' and try_to_run('ionice'): + if ionice == 'idle': + args.extend(['ionice', '-c3', '-t']) + else: + args.extend(['ionice', '-c2', '-n' + ionice, '-t']) + args.extend(['rdiff-backup']) if cfg['host']: @@ -968,7 +974,7 @@ elif server_minor > client_minor: warn('Protocol mismatch: %s <> %s' % (PROTOCOL, client_protocol)) -def do_server(cfgs, ids, nice, force, cleanup): +def do_server(cfgs, ids, nice, ionice, force, cleanup): debug("Do server main loop") for cfg in cfgs.itervalues(): id = cfg['id'] @@ -1038,7 +1044,7 @@ else: backup_marker = None - do_server_rdiff(cfg, bdir, nice, force) + do_server_rdiff(cfg, bdir, nice, ionice, force) errs = 0 if os.path.isdir(rdiff_logdir): @@ -1441,6 +1447,9 @@ 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') + if ionice_def is None: ionice_def = 'idle' + if ionice_def is '': ionice_def = 'none' global default_bandwidth default_bandwidth['overall'] = get_int('bandwidth.limit') or 0 @@ -1489,7 +1498,7 @@ if mode is 'server': is_client = False verbosity_level = 1 + verbosity - do_server(cfgs, args, nice_srv, force, cleanup) + do_server(cfgs, args, nice_srv, ionice_def, force, cleanup) elif mode is 'list': if list_type is None: list_type = 'increments' Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2010-11-19 22:05:07 UTC (rev 703) +++ safekeep/trunk/safekeep.conf 2010-11-21 19:09:13 UTC (rev 704) @@ -17,6 +17,10 @@ # to disable nice, set it to 0 # nice.adjustment = 10 +# Default io niceness level used on the server side. +# Set this to 'none' to disable ionice(1)-ness +# ionice.adjustment = idle + # A default bandwidth limit for both download/upload # bandwidth.limit=100 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: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: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 18:02:03
|
Revision: 749 http://safekeep.svn.sourceforge.net/safekeep/?rev=749&view=rev Author: dimi Date: 2011-03-06 18:01:57 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Prep release 1.3.2 Modified Paths: -------------- safekeep/trunk/ANNOUNCE safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/ANNOUNCE =================================================================== --- safekeep/trunk/ANNOUNCE 2011-03-06 17:50:53 UTC (rev 748) +++ safekeep/trunk/ANNOUNCE 2011-03-06 18:01:57 UTC (rev 749) @@ -1,26 +1,31 @@ -This is release 1.3.1 of SafeKeep, a centralized and easy to use +This is release 1.3.2 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. + - More fixes for dealing with LVN snapshots, SSH key delivery. + - Fix a new typos and errors introduced in 1.3.1. + - Improved installation from source (aka 'make install'). +Many thanks to Frank Crawford and Oliver Henshaw for the fixes +that made this release possible. + 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 + http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.3.2-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.2-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.2-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 + http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.2_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.2_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.2_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 + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.2.tar.gz + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.2-1.src.rpm To find out more about the project visit on our website: http://safekeep.sourceforge.net Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-03-06 17:50:53 UTC (rev 748) +++ safekeep/trunk/safekeep.spec.in 2011-03-06 18:01:57 UTC (rev 749) @@ -107,6 +107,13 @@ %doc samples/sample.backup %changelog +* Sun Mar 6 2010 Dimi Paun <di...@la...> 1.3.2-1 + - Fixed some issued introduced by the new subprocess wrappers. + - Always return multi-line output from subprocesses as an array of strings. + - Better source-based installation and documentation. + - Add explanation of the packaging structure. + - Source, documentation, and packaging cleanups. + * Mon Nov 22 2010 Dimi Paun <di...@la...> 1.3.1-1 - Fix a few serios errors preventing safekeep from running. - Better reporting of client messages and exceptions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2011-08-31 13:02:50
|
Revision: 759 http://safekeep.svn.sourceforge.net/safekeep/?rev=759&view=rev Author: dimi Date: 2011-08-31 13:02:44 +0000 (Wed, 31 Aug 2011) Log Message: ----------- Marco Bozzolan <ma...@s1...> Allow to specify a sender address for the log messages sent via e-mail. Modified Paths: -------------- safekeep/trunk/doc/safekeep.conf.txt safekeep/trunk/safekeep safekeep/trunk/safekeep.conf Modified: safekeep/trunk/doc/safekeep.conf.txt =================================================================== --- safekeep/trunk/doc/safekeep.conf.txt 2011-06-11 16:14:14 UTC (rev 758) +++ safekeep/trunk/doc/safekeep.conf.txt 2011-08-31 13:02:44 UTC (rev 759) @@ -31,6 +31,10 @@ If not specified, it defaults to the home directory of the backup user. +email.from:: + The email address to be used as sender when sending the logs. + If not specified `safekeep` will use SafeKeep@<hostname fqdn>. + 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 2011-06-11 16:14:14 UTC (rev 758) +++ safekeep/trunk/safekeep 2011-08-31 13:02:44 UTC (rev 759) @@ -242,21 +242,23 @@ return None return out or '' -def send_notification(email, smtp): +def send_notification(email_from, 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 + \ + hostname = socket.getfqdn() + if not email_from: + email_from = 'SafeKeep@' + hostname + msg = 'From: ' + email_from + \ '\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.sendmail(email_from, email, msg) server.quit() else: - cmd = ['/usr/sbin/sendmail', '-t'] + cmd = ['/usr/sbin/sendmail', '-t', '-f', email_from] call(cmd, stdin=msg) def is_temp_root(dir): @@ -1503,6 +1505,8 @@ smtp = props['email.smtp.server'] if 'email.to' in props: email = props['email.to'].split(',') + if 'email.from' in props: + email_from = props['email.from'] nice_def = get_int('nice.adjustment') if nice_def is None: nice_def = 10 nice_srv = get_int('nice.adjustment.server') or nice_def @@ -1589,7 +1593,7 @@ error('ERROR: %s' % (ex or ''), ex) if email and not noemail: - send_notification(email, smtp) + send_notification(email_from, email, smtp) if __name__ == '__main__': main() Modified: safekeep/trunk/safekeep.conf =================================================================== --- safekeep/trunk/safekeep.conf 2011-06-11 16:14:14 UTC (rev 758) +++ safekeep/trunk/safekeep.conf 2011-08-31 13:02:44 UTC (rev 759) @@ -33,5 +33,8 @@ # a comma separated list of emails to receive the logs # email.to=pe...@co...,ro...@co... +# An email address to be used as sender +# email.from = saf...@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: <fcr...@us...> - 2011-11-20 05:56:47
|
Revision: 767 http://safekeep.svn.sourceforge.net/safekeep/?rev=767&view=rev Author: fcrawford Date: 2011-11-20 05:56:41 +0000 (Sun, 20 Nov 2011) Log Message: ----------- Prep release 1.3.3 Modified Paths: -------------- safekeep/trunk/ANNOUNCE safekeep/trunk/doc/users safekeep/trunk/safekeep.spec.in Modified: safekeep/trunk/ANNOUNCE =================================================================== --- safekeep/trunk/ANNOUNCE 2011-11-20 05:35:31 UTC (rev 766) +++ safekeep/trunk/ANNOUNCE 2011-11-20 05:56:41 UTC (rev 767) @@ -1,35 +1,38 @@ -This is release 1.3.2 of SafeKeep, a centralized and easy to use +This is release 1.3.3 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. - - More fixes for dealing with LVN snapshots, SSH key delivery. - - Fix a new typos and errors introduced in 1.3.1. - - Improved installation from source (aka 'make install'). + - More fixes for dealing with LVM snapshots. + - Better handling of other failure conditions. + - Updates for Python syntax issues and changes. + - Allow specification of a sender address in e-mail messages. + - Better handling of ionice(1). -Many thanks to Frank Crawford and Oliver Henshaw for the fixes -that made this release possible. +Many thanks to Marco Bozzolan and Harald Nehring for the fixes +that made this release possible, and to Dimi Paun for his continual +work with SafeKeep, who is currently having a life away from computers. 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.2-1.noarch.rpm - http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.2-1.noarch.rpm - http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.2-1.noarch.rpm + - RedHat EL/CentOS 3,4,5,6 Fedora 8,9,10,11,12,13,14,15,16: + http://prdownloads.sourceforge.net/safekeep/safekeep-common-1.3.3-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-client-1.3.3-1.noarch.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-server-1.3.3-1.noarch.rpm - Ubuntu Edgy, Dapper, Breezy, Hardy, Karmic, Lucid, Maverick, and Natty: - http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.2_all.deb - http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.2_all.deb - http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.2_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-common_1.3.3_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-client_1.3.3_all.deb + http://prdownloads.sourceforge.net/safekeep/safekeep-server_1.3.3_all.deb - Source: - http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.2.tar.gz - http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.2-1.src.rpm + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.3.tar.gz + http://prdownloads.sourceforge.net/safekeep/safekeep-1.3.3-1.src.rpm To find out more about the project visit on our website: http://safekeep.sourceforge.net -- -Dimi Paun <di...@la...> +Frank Crawford <fr...@cr...> +for Dimi Paun <di...@la...> Lattica, Inc. Modified: safekeep/trunk/doc/users =================================================================== --- safekeep/trunk/doc/users 2011-11-20 05:35:31 UTC (rev 766) +++ safekeep/trunk/doc/users 2011-11-20 05:56:41 UTC (rev 767) @@ -5,3 +5,4 @@ ed Eduard Malinschi <ed...@la...> mihai Mihai Popa <mi...@la...> stelian Stelian Pop <st...@la...> +frank Frank Crawford <fr...@cr...> Modified: safekeep/trunk/safekeep.spec.in =================================================================== --- safekeep/trunk/safekeep.spec.in 2011-11-20 05:35:31 UTC (rev 766) +++ safekeep/trunk/safekeep.spec.in 2011-11-20 05:56:41 UTC (rev 767) @@ -107,6 +107,13 @@ %doc samples/sample.backup %changelog +* Sun Nov 20 2011 Frank Crawford <fr...@cr...> 1.3.3-1 + - More fixes for dealing with LVM snapshots. + - Better handling of other failure conditions. + - Updates for Python syntax issues and changes. + - Allow specification of a sender address in e-mail messages. + - Better handling of ionice(1). + * Sun Mar 6 2011 Dimi Paun <di...@la...> 1.3.2-1 - Fixed some issued introduced by the new subprocess wrappers. - Always return multi-line output from subprocesses as an array of strings. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fcr...@us...> - 2011-12-30 08:43:57
|
Revision: 782 http://safekeep.svn.sourceforge.net/safekeep/?rev=782&view=rev Author: fcrawford Date: 2011-12-30 08:43:51 +0000 (Fri, 30 Dec 2011) Log Message: ----------- Added LVM snapshot LV tagging support as requested by Andres Toomsalu Modified Paths: -------------- safekeep/trunk/doc/safekeep.backup.txt safekeep/trunk/safekeep Modified: safekeep/trunk/doc/safekeep.backup.txt =================================================================== --- safekeep/trunk/doc/safekeep.backup.txt 2011-12-25 13:40:47 UTC (rev 781) +++ safekeep/trunk/doc/safekeep.backup.txt 2011-12-30 08:43:51 UTC (rev 782) @@ -242,6 +242,12 @@ of the original device's size. Mandatory for a `<snapshot>` element. +/backup/setup/snapshot/@tag:: + A tag to be added to the snapshot, with the `--addtag` argument + to `lvcreate`. An `@` is automatically added to the generated + tag. + Optional for a `<snapshot>` element. + /backup/setup/script/@path:: Execute the script specified path on the client at certain steps of the backup process. Modified: safekeep/trunk/safekeep =================================================================== --- safekeep/trunk/safekeep 2011-12-25 13:40:47 UTC (rev 781) +++ safekeep/trunk/safekeep 2011-12-30 08:43:51 UTC (rev 782) @@ -328,7 +328,8 @@ size = snap_el.getAttribute('size') if not size: raise ConfigException('Please specify the size for the snapshot') - return { 'device' : device, 'size' : size } + tag = snap_el.getAttribute('tag') + return { 'device' : device, 'size' : size, 'tag' : tag } def parse_clude(clude_el): path = clude_el.getAttribute('path') @@ -681,8 +682,14 @@ if not snapmnt: warn('Cannot find the mountpoint for: %s' % device) continue - args = ['lvcreate', '--snapshot', '--size', snap['size'], - '--name', os.path.basename(snapdev), lvmdev] + tag = snap['tag'] + if tag: + args = ['lvcreate', '--addtag', '@' + tag, + '--snapshot', '--size', snap['size'], + '--name', os.path.basename(snapdev), lvmdev] + else: + 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) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |