From: Martin Langhoff <[EMAIL PROTECTED]> The underscores only added confusion - for example the cron.d entry was broken.
Also removed growdatastore.py from the RPM, and moved it to a more explicit devutils. It is only really useful for development, no need for in on the XOs. --- Makefile.build | 5 ++--- client/{ds_backup.py => ds-backup.py} | 4 ++-- client/{ds_backup.sh => ds-backup.sh} | 12 ++++++------ {utils => devutils}/growdatastore.py | 0 ds-backup.spec.in | 5 ++--- 5 files changed, 12 insertions(+), 14 deletions(-) rename client/{ds_backup.py => ds-backup.py} (97%) rename client/{ds_backup.sh => ds-backup.sh} (92%) rename {utils => devutils}/growdatastore.py (100%) diff --git a/Makefile.build b/Makefile.build index 2dad82a..78de8d4 100644 --- a/Makefile.build +++ b/Makefile.build @@ -3,9 +3,8 @@ install-client: install -D -d $(DESTDIR)/usr/bin - install -D client/ds_backup.py $(DESTDIR)/usr/bin/ - install -D client/ds_backup.sh $(DESTDIR)/usr/bin/ - install -D utils/growdatastore.py $(DESTDIR)/usr/bin/ + install -D client/ds-backup.py $(DESTDIR)/usr/bin/ + install -D client/ds-backup.sh $(DESTDIR)/usr/bin/ install -D -d $(DESTDIR)/etc install -D -m 644 client/cron-ds-backup.conf $(DESTDIR)/etc/cron.d/ds-backup diff --git a/client/ds_backup.py b/client/ds-backup.py similarity index 97% rename from client/ds_backup.py rename to client/ds-backup.py index 0194fa4..f594293 100755 --- a/client/ds_backup.py +++ b/client/ds-backup.py @@ -124,7 +124,7 @@ if __name__ == "__main__": # Check backup server availability. # On 503 ("too busy") apply exponential back-off # over 10 attempts. Combined with the staggered sleep - # in ds_backup.sh, this should keep thundering herds + # in ds-backup.sh, this should keep thundering herds # under control. We are also holding a flock to prevent # local races. # With range(1,7) we sleep up to 64 minutes. @@ -134,7 +134,7 @@ if __name__ == "__main__": # cleared to run 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') + os.system('touch ~/.sugar/default/ds-backup-done') exit(0) elif (sstatus == 503): # exponenxtial backoff diff --git a/client/ds_backup.sh b/client/ds-backup.sh similarity index 92% rename from client/ds_backup.sh rename to client/ds-backup.sh index 960438a..c53760e 100755 --- a/client/ds_backup.sh +++ b/client/ds-backup.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Wrapper around ds_backup - will be called in 2 situations +# Wrapper around ds-backup - will be called in 2 situations # # - On cron, every 30 minutes during waking/school hours # If you are calling this from cron, pass 'cron' as @@ -51,7 +51,7 @@ function skip_noschoolnet { # function skip_ifrecent { RECENT_CHECK='-daystart -mtime 0' - if [ `find ~/.sugar/default/ds_backup-done $RECENT_CHECK 2>/dev/null` ] + if [ `find ~/.sugar/default/ds-backup-done $RECENT_CHECK 2>/dev/null` ] then exit 0 fi @@ -131,18 +131,18 @@ fi # another invokation that got the job done while we slept skip_ifrecent; -# Execute ds_backup.py from the same +# Execute ds-backup.py from the same # directory where we are. Use a flock # to prevent concurrent runs. If the # flock does not succeed immediately, # we quit. -LOCKFILE=~/.sugar/default/lock/ds_backup.run -flock -n $LOCKFILE `dirname $0 `/ds_backup.py +LOCKFILE=~/.sugar/default/lock/ds-backup.run +flock -n $LOCKFILE `dirname $0 `/ds-backup.py EXITCODE=$? # Note: we keep the lockfile around to save # NAND cycles. -# Propagate the exit code of the flock/ds_backup invocation +# Propagate the exit code of the flock/ds-backup invocation exit $EXITCODE diff --git a/utils/growdatastore.py b/devutils/growdatastore.py similarity index 100% rename from utils/growdatastore.py rename to devutils/growdatastore.py diff --git a/ds-backup.spec.in b/ds-backup.spec.in index ef1f126..97919e1 100644 --- a/ds-backup.spec.in +++ b/ds-backup.spec.in @@ -70,9 +70,8 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc README COPYING AUTHORS %config(noreplace) %{_sysconfdir}/cron.d/ds-backup -%{_bindir}/ds_backup.py -%{_bindir}/ds_backup.sh -%{_bindir}/growdatastore.py +%{_bindir}/ds-backup.py +%{_bindir}/ds-backup.sh %files server %defattr(-,root,root,-) -- 1.5.6.dirty _______________________________________________ Server-devel mailing list Server-devel@lists.laptop.org http://lists.laptop.org/listinfo/server-devel