[PC-BSD Commits] r4696 - in pcbsd/trunk/lifePreserver: conf scripts

svn at pcbsd.org svn at pcbsd.org
Tue Oct 20 20:26:30 PDT 2009


Author: kris
Date: 2009-10-20 20:26:30 -0700 (Tue, 20 Oct 2009)
New Revision: 4696

Modified:
   pcbsd/trunk/lifePreserver/conf/rsync-excludes
   pcbsd/trunk/lifePreserver/scripts/start-backup.sh
Log:

Updated our backup scripts, rsync is working great now, restoring brings back user/group and permissions properly,
setup upload of log files that are compressed to save bandwidth, and we can use them for showing a file-selection
dialog in the GUI eventually. 



Modified: pcbsd/trunk/lifePreserver/conf/rsync-excludes
===================================================================
--- pcbsd/trunk/lifePreserver/conf/rsync-excludes	2009-10-21 02:32:18 UTC (rev 4695)
+++ pcbsd/trunk/lifePreserver/conf/rsync-excludes	2009-10-21 03:26:30 UTC (rev 4696)
@@ -7,3 +7,4 @@
 /usr/portjail/proc
 /usr/portjail/tmp
 /usr/portjail/usr/home
+/var/db/dhclient*

Modified: pcbsd/trunk/lifePreserver/scripts/start-backup.sh
===================================================================
--- pcbsd/trunk/lifePreserver/scripts/start-backup.sh	2009-10-21 02:32:18 UTC (rev 4695)
+++ pcbsd/trunk/lifePreserver/scripts/start-backup.sh	2009-10-21 03:26:30 UTC (rev 4696)
@@ -17,17 +17,18 @@
 mkdir /PCBSD/lifePreserver/logs >/dev/null 2>/dev/null
 
 # Make sure we have the BACKDIR created
-ssh ${SSHHOST} "mkdir ${BACKDIR}"
+ssh ${SSHHOST} "mkdir -p ${BACKDIR}"
 
 rsync -avvz \
   --delete \
   --delete-excluded \
+  --rsync-path="rsync --fake-super" \
   --perms --chmod=o-t \
-  --out-format='./%f %L PERM=%B UID=%U GID=%G SIZE=%l DATE=%M' \
+  --log-file=${BACKLOG} \
   --exclude-from ${EXCLUDELIST} \
+  -e ssh \
   --link-dest=../current \
-  -e ssh \
-  / ${SSHHOST}:${BACKDIR}/incomplete_back-$DATE 2>&1 | tee ${BACKLOG} 2>&1 \
+  / ${SSHHOST}:${BACKDIR}/incomplete_back-$DATE \
   && ssh ${SSHHOST} \
   "mv ${BACKDIR}/incomplete_back-$DATE ${BACKDIR}/back-$DATE \
   && rm -f ${BACKDIR}/current \
@@ -35,11 +36,12 @@
 
 if [ "$?" = "0" ]
 then
+  bzip2 ${BACKLOG}
   # Success!
   # Copy the logfile to the backup dir
 sftp ${SSHHOST} << EOF
-cd current
-put ${BACKLOG}
+cd ${BACKDIR}/current
+put ${BACKLOG}.bz2 backup.log.bz2
 quit
 EOF
 



More information about the Commits mailing list