aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-08 21:09:07 -0500
committerDave Reisner <d@falconindy.com>2010-01-08 21:09:07 -0500
commit29c1bf01c73e9234dc39aa551aac32bf5fa6c1a4 (patch)
tree347c3924413f520b5bcea71acfeb7e234e750214
parentb2894c337ef2ed12b218238c5e617d2ed622b999 (diff)
downloadsquashfu-29c1bf01c73e9234dc39aa551aac32bf5fa6c1a4.tar.gz
I take it back, I do want a query dispatcher to parse for sanity
-rwxr-xr-xsquashfu14
1 files changed, 10 insertions, 4 deletions
diff --git a/squashfu b/squashfu
index 9669f82..3c14197 100755
--- a/squashfu
+++ b/squashfu
@@ -134,9 +134,9 @@ query_usage () {
bin_size=$(du -s ${BKUP_ROOT}/bins 2>/dev/null | awk '{print $1}')
sfs_size=$(stat -c %s $SEED 2>/dev/null)
- info "Usage report:\n"
- printf "%30s %10.2f MiB\n" "Seed size:" "`echo "scale=2;$sfs_size / 1024 / 1024" | bc`"
- printf "%30s %10.2f MiB\n" "Total incremental size:" "`echo "scale=2;$bin_size / 1024 / 1024" | bc`"
+ info "Usage report (in mb):\n"
+ printf "%30s %10.2f\n" "Seed size:" "`echo "scale=2;$sfs_size / 1024 / 1024" | bc`"
+ printf "%30s %10.2f\n" "Total incremental size:" "`echo "scale=2;$bin_size / 1024 / 1024" | bc`"
if [[ $bin_size -gt $sfs_size ]]; then
info "Your incrementals are larger than your seed! You might consider resquashing your backup with $0 --resquash"
@@ -236,6 +236,12 @@ dispatch_backup () {
done
}
+dispatch_query () {
+ # Don't check anything, just run the query.
+ # TODO: Add levels of querying
+ query_usage
+}
+
dispatch_rollback () {
# Check arguments conform
[[ $# -eq 0 || $# -gt 2 ]] && {
@@ -267,7 +273,7 @@ dispatch_rollback () {
while [[ $# -gt 0 ]]; do
case $1 in
"-B") shift; dispatch_backup $* ;;
- "-Q") shift; query_usage $* ;;
+ "-Q") shift; dispatch_query ;;
"-R") shift; dispatch_rollback $* ;;
*) usage ;;
esac