[Server-devel] [PATCH] postprocess.py gets fleshed out, and incrontab tweaks

2008-06-26 Thread martin . langhoff
From: Martin Langhoff [EMAIL PROTECTED]

postprocess.py now provides hardlinked timestamped
directories, and maintains a symlink pointing to
the latest transferred directory.

The timestamped directories are maintained with a resolution
of the nearest minute - we don't expect to have more
than one per hour.

The incrond crontab gets updated to deal well with rsync
clients too. To work well with rsync, the rsync client must
use the -T option to avoid creating tempfiles in the monitored
directory.

Strangely, incrond cannot handle comments on its tab files, so
we workaround that for the moment. This is known as bug 173 in the
incrond bugtracker (bts.aiken.cz).
---
 server/incron-ds-backup.comments |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 server/incron-ds-backup.comments

diff --git a/server/incron-ds-backup.comments b/server/incron-ds-backup.comments
new file mode 100644
index 000..6edb8d8
--- /dev/null
+++ b/server/incron-ds-backup.comments
@@ -0,0 +1,11 @@
+## NOTE: incrond v0.5.5 cannot cope with
+## comments in its tab files. So we
+## put them here, until incrontab gets
+## better at this :-)
+
+# We monitor create and move to, because
+# while touch/echo will trigger IN_CREATE,
+# rsync transfers (use the -T flag!) will
+# create the file in a tempdir and then mv
+# it into place. Again: use rsync -T /tmp
+# : [EMAIL PROTECTED]
-- 
1.5.6.dirty

___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


[Server-devel] [PATCH] ds-backup client - fix rsync paths to the XS.

2008-06-26 Thread martin . langhoff
From: Martin Langhoff [EMAIL PROTECTED]

---
 client/ds_backup.py |8 +---
 client/ds_backup.sh |2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/ds_backup.py b/client/ds_backup.py
index 60d0be2..089a2e9 100755
--- a/client/ds_backup.py
+++ b/client/ds_backup.py
@@ -83,9 +83,11 @@ def rsync_to_xs(from_path, to_path, keyfile, user):
 
 # Transfer an empty file marking completion
 # so the XS can see we are done.
+# Note: the dest dir on the XS is watched via
+# inotify - so we avoid creating tempfiles there.
 tmpfile = tempfile.mkstemp()
-rsync = (/usr/bin/rsync --timeout 10 -e '%s' '%s' '%s' 
- % (ssh, tmpfile[1], to_path+'/.transfer_complete'))
+rsync = (/usr/bin/rsync --timeout 10 -T /tmp -e '%s' '%s' '%s' 
+ % (ssh, tmpfile[1], 
'schoolserver:/var/lib/ds-backup/completion/'+user))
 rsync_p = popen2.Popen3(rsync, True)
 rsync_exit = os.WEXITSTATUS(rsync_p.wait())
 if rsync_exit != 0:
@@ -130,7 +132,7 @@ if __name__ == __main__:
 sstatus = check_server_available(backup_url, sn)
 if (sstatus == 200):
 # cleared to run
-rsync_to_xs(ds_path, 'schoolserver:datastore', pk_path, sn)
+rsync_to_xs(ds_path, 'schoolserver:datastore-current', pk_path, sn)
 # this marks success to the controlling script...
 os.system('touch ~/.sugar/default/ds_backup-done')
 exit(0)
diff --git a/client/ds_backup.sh b/client/ds_backup.sh
index 9916334..334e4eb 100755
--- a/client/ds_backup.sh
+++ b/client/ds_backup.sh
@@ -121,7 +121,7 @@ fi
 #  We use this to stagger client machines in the 30 minute
 #  slots between cron invocations...
 #  (yes we need all the parenthesys)
-(sleep $(($RANDOM % 1200)));
+#(sleep $(($RANDOM % 1200)));
 
 # After the sleep, check again. Perhaps something triggered
 # another invokation that got the job done while we slept
-- 
1.5.6.dirty

___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel