G'day Juliano,
Looks good. Here are some ideas as a patch.
1. move the common configuration variables to a single file,
2. move the excludes file to be next to configuration file,
3. add a way to describe the license,
4. begin a make file for installation,
5. use --archive instead of -a, since other options are spelled out.
--
James Cameron mailto:[EMAIL PROTECTED] http://quozl.netrek.org/
Tue May 1 14:32:59 EST 2007 [EMAIL PROTECTED]
* make configuration file
Makes a configuration file for the configuration variables used by the
scripts, so that one place only needs to be changed.
Adds a Makefile to hint at installation sequence.
Places the exclude file in a location consistent with a package name.
diff -rN -u old-olpc-user-data-backup/COPYING new-olpc-user-data-backup/COPYING
--- old-olpc-user-data-backup/COPYING 1970-01-01 10:00:00.000000000 +1000
+++ new-olpc-user-data-backup/COPYING 2007-05-01 14:35:29.000000000 +1000
@@ -0,0 +1 @@
+(license to be determined)
diff -rN -u old-olpc-user-data-backup/Makefile new-olpc-user-data-backup/Makefile
--- old-olpc-user-data-backup/Makefile 1970-01-01 10:00:00.000000000 +1000
+++ new-olpc-user-data-backup/Makefile 2007-05-01 14:35:29.000000000 +1000
@@ -0,0 +1,7 @@
+install:
+ mkdir /etc/olpc-backup
+ mkdir /usr/local/bin
+ install olpc-backup /usr/local/bin
+ install olpc-restore /usr/local/bin
+ cp config /etc/olpc-backup/
+ cp excludes /etc/olpc-backup/
diff -rN -u old-olpc-user-data-backup/backup_excludes new-olpc-user-data-backup/backup_excludes
--- old-olpc-user-data-backup/backup_excludes 2007-05-01 14:35:29.000000000 +1000
+++ new-olpc-user-data-backup/backup_excludes 1970-01-01 10:00:00.000000000 +1000
@@ -1 +0,0 @@
-Library
diff -rN -u old-olpc-user-data-backup/config new-olpc-user-data-backup/config
--- old-olpc-user-data-backup/config 1970-01-01 10:00:00.000000000 +1000
+++ new-olpc-user-data-backup/config 2007-05-01 14:35:29.000000000 +1000
@@ -0,0 +1,19 @@
+# olpc-user-data-backup configuration file
+
+# directory to backup
+BDIR=/home/olpc/
+
+# excludes file - this contains a wildcard pattern per line of files to exclude
+EXCLUDES=/etc/olpc-backup/excludes
+
+# the name of the backup machine
+BSERVER=192.168.0.1
+
+# the directory, derived from the first hardware MAC address
+DIRNAME=`/sbin/ifconfig -a | grep 'HWaddr' | head -1 | awk '{ print $5 }'`
+
+# your password on the backup server
+#export RSYNC_PASSWORD=vai_will
+
+# compose the backup directory name
+BACKUPDIR=$BDIR/backup/$DIRNAME
diff -rN -u old-olpc-user-data-backup/excludes new-olpc-user-data-backup/excludes
--- old-olpc-user-data-backup/excludes 1970-01-01 10:00:00.000000000 +1000
+++ new-olpc-user-data-backup/excludes 2007-05-01 14:35:29.000000000 +1000
@@ -0,0 +1 @@
+Library
diff -rN -u old-olpc-user-data-backup/olpc-backup new-olpc-user-data-backup/olpc-backup
--- old-olpc-user-data-backup/olpc-backup 2007-05-01 14:35:29.000000000 +1000
+++ new-olpc-user-data-backup/olpc-backup 2007-05-01 14:35:29.000000000 +1000
@@ -2,29 +2,12 @@
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin
-# directory to backup
-BDIR=/home/olpc/
-
-# excludes file - this contains a wildcard pattern per line of files to exclude
-EXCLUDES=/etc/backup_excludes
-
-# the name of the backup machine
-BSERVER=192.168.0.1
-
-DIRNAME=`/sbin/ifconfig -a | grep 'HWaddr' | head -1 | awk '{ print $5 }'`;
-
-# your password on the backup server
-#export RSYNC_PASSWORD=vai_will
-
-
-########################################################################
-
-BACKUPDIR=$BDIR/backup/$DIRNAME
+. /etc/olpc-backup/config
OPTS="--force --ignore-errors --exclude-from=$EXCLUDES
- --delete -a"
+ --delete --archive"
-# now the actual transfer
rsync $OPTS $BDIR $BSERVER::olpc/$DIRNAME
+# force success return
exit 0
diff -rN -u old-olpc-user-data-backup/olpc-restore new-olpc-user-data-backup/olpc-restore
--- old-olpc-user-data-backup/olpc-restore 2007-05-01 14:35:29.000000000 +1000
+++ new-olpc-user-data-backup/olpc-restore 2007-05-01 14:35:29.000000000 +1000
@@ -2,27 +2,9 @@
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin
-# directory to backup
-BDIR=/home/olpc/
-
-# excludes file - this contains a wildcard pattern per line of files to exclude
-EXCLUDES=/etc/backup_excludes
-
-# the name of the backup machine
-BSERVER=192.168.0.1
-
-DIRNAME=`/sbin/ifconfig -a | grep 'HWaddr' | head -1 | awk '{ print $5 }'`;
-
-# your password on the backup server
-#export RSYNC_PASSWORD=vai_will
-
-
-########################################################################
-
-BACKUPDIR=$BDIR/backup/$DIRNAME
+. /etc/olpc-backup/config
OPTS="--force --ignore-errors --exclude-from=$EXCLUDES
- --delete -a"
+ --delete --archive"
-# now the actual transfer
rsync $OPTS $BSERVER::olpc/$DIRNAME/ $BDIR
_______________________________________________
Devel mailing list
[email protected]
http://mailman.laptop.org/mailman/listinfo/devel