aboutsummaryrefslogtreecommitdiffstats
path: root/squashfu
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-12 11:39:27 -0500
committerDave Reisner <d@falconindy.com>2010-01-12 11:39:27 -0500
commitb7c5aa27df6972b1c854e0a06c57a2be96ece41f (patch)
tree875d789d931b305312af6a5203170cb94208a6af /squashfu
parent907e3b7d04bf852dae24440ea9632fd0cb00ff18 (diff)
downloadsquashfu-b7c5aa27df6972b1c854e0a06c57a2be96ece41f.tar.gz
Implement insanely simple bin report with creation date only
Diffstat (limited to 'squashfu')
-rwxr-xr-xsquashfu13
1 files changed, 11 insertions, 2 deletions
diff --git a/squashfu b/squashfu
index 77fd493..db1bb7c 100755
--- a/squashfu
+++ b/squashfu
@@ -299,15 +299,24 @@ action_rollback () {
}
action_report () {
- debug "IOU: one status report"; exit 0
# Enumerate bins, sort by order, provide size and convert timestamp to human readable
- # use $(date --date="1970-01-01 $TIMESTAMP sec GMT")
+
+ OLDIFS=$IFS
+ IFS='$:'
+
+ printf "%10s\t%30s\n" "Bin" "Date Created"
+ grep -vE "^[\t ]*$" "$BINVENTORY" | sort -r -k2 -n | while read bin stamp; do
+ printf "%10d\t%30s\n" $bin "$(date --rfc-3339=seconds --date="1970-01-01 $stamp sec GMT")"
+ done
+
+ IFS=$OLDIFS
}
case $1 in
"-B") action_backup ;;
"-R") shift; action_rollback $1 ;;
+ "-Q") action_report ;;
"-U") unmount_all ;;
*) "Invalid action" ;;
esac