|
From: <di...@us...> - 2007-03-08 20:35:46
|
Revision: 445
http://safekeep.svn.sourceforge.net/safekeep/?rev=445&view=rev
Author: dimi
Date: 2007-03-08 12:35:44 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
Add property that controls the data repo base dir
Modified Paths:
--------------
safekeep/trunk/doc/safekeep.conf.txt
safekeep/trunk/safekeep
safekeep/trunk/sample.conf
Modified: safekeep/trunk/doc/safekeep.conf.txt
===================================================================
--- safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 20:27:15 UTC (rev 444)
+++ safekeep/trunk/doc/safekeep.conf.txt 2007-03-08 20:35:44 UTC (rev 445)
@@ -26,6 +26,11 @@
If not specified, `safekeep` will just run under the
current user.
+base.dir::
+ The base directory for date repository relative paths.
+ If not specified, it defaults to the home directory
+ of the backup user.
+
email.to::
In addition to writing the session logs
on the standard output, `safekeep` can also send the
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2007-03-08 20:27:15 UTC (rev 444)
+++ safekeep/trunk/safekeep 2007-03-08 20:35:44 UTC (rev 445)
@@ -13,6 +13,7 @@
work_user = getpass.getuser()
backup_user = None
home_dir = None
+base_dir = None
PROTOCOL = "1.0"
VERSION = "0.9.1"
@@ -203,6 +204,7 @@
elif len(repo_el) > 1:
raise ConfigException('Can not have more than a repo element')
if not dir: dir = id
+ dir = os.path.join(base_dir, dir)
setup_el = backup_el.getElementsByTagName('setup')
dumps = []
@@ -800,7 +802,7 @@
except getopt.GetoptError:
usage(2)
- global backup_user, home_dir
+ global backup_user, home_dir, base_dir
mode = None
email = []
smtp = None
@@ -879,6 +881,8 @@
props = {}
if 'backup.user' in props:
backup_user = props['backup.user']
+ if 'base.dir' in props:
+ base_dir = props['base.dir']
if 'email.smtp.server' in props:
smtp = props['email.smtp.server']
if 'email.to' in props:
@@ -897,6 +901,9 @@
backup_user = work_user
home_dir = os.getenv('HOME', '/')
+ if not base_dir:
+ base_dir = home_dir
+
if len(cfglocs) > 0:
cfgs = parse_locs(cfglocs)
else:
Modified: safekeep/trunk/sample.conf
===================================================================
--- safekeep/trunk/sample.conf 2007-03-08 20:27:15 UTC (rev 444)
+++ safekeep/trunk/sample.conf 2007-03-08 20:35:44 UTC (rev 445)
@@ -7,6 +7,9 @@
# the user under which the server will run
# backup.user = safekeep
+# the base directory for data repository relative paths
+# base.dir = /var/lib/safekeep
+
# a comma separated list of emails to receive the logs
# ema...@co...,ro...@co...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|