summaryrefslogtreecommitdiffstats
path: root/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-05-22 20:43:01 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-05-22 20:43:01 -0400
commitff161129ab87735eccc2ffba61db977ff4d4cd8c (patch)
treec7b2ba2de39bc4e398b0a93c1b666a485b9f5daa /PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base
parent4e9203174a2172e2321839b1a59bcbde0ebf8f24 (diff)
downloadpfsense-ff161129ab87735eccc2ffba61db977ff4d4cd8c.zip
pfsense-ff161129ab87735eccc2ffba61db977ff4d4cd8c.tar.gz
Adding pc-sysinstall so that I can start experimenting with a php based installer. This is necssary because PCBSD must live in the root of the disk and there is no way to include it in a unionfs. By default it will not be copied to a new hard disk installation.
Diffstat (limited to 'PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base')
-rw-r--r--PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base44
1 files changed, 44 insertions, 0 deletions
diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base
new file mode 100644
index 0000000..6b32fb1
--- /dev/null
+++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Script which lists the backups present on a server
+###########################################################################
+
+. ${PROGDIR}/backend/functions.sh
+
+SSHUSER=$1
+SSHHOST=$2
+SSHPORT=$3
+
+if [ -z "${SSHHOST}" -o -z "${SSHPORT}" ]
+then
+ echo "ERROR: Usage list-rsync-backups.sh <user> <host> <port>"
+ exit 150
+fi
+
+# Look for full-system backups, needs at minimum a kernel to be bootable
+FINDCMD="find . -type d -maxdepth 6 -name 'kernel' | grep '/boot/kernel'"
+
+# Get a listing of the number of full backups saved
+OLDBACKUPS=`ssh -o 'BatchMode=yes' -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "${FINDCMD}"`
+if [ "$?" = "0" ]
+then
+ for i in ${OLDBACKUPS}
+ do
+ BACKPATH="`echo ${i} | sed 's|/boot/.*||g' | sed 's|^./||g'`"
+ if [ -z "${BACKLIST}" ]
+ then
+ BACKLIST="${BACKPATH}"
+ else
+ BACKLIST="${BACKLIST}:${BACKPATH}"
+ fi
+ done
+
+ if [ -z "${BACKLIST}" ]
+ then
+ echo "NONE"
+ else
+ echo "$BACKLIST"
+ fi
+
+else
+ echo "FAILED"
+fi
OpenPOWER on IntegriCloud