diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 11:39:27 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 11:39:27 -0500 |
commit | b7c5aa27df6972b1c854e0a06c57a2be96ece41f (patch) | |
tree | 875d789d931b305312af6a5203170cb94208a6af | |
parent | 907e3b7d04bf852dae24440ea9632fd0cb00ff18 (diff) | |
download | squashfu-b7c5aa27df6972b1c854e0a06c57a2be96ece41f.tar.gz |
Implement insanely simple bin report with creation date only
-rwxr-xr-x | squashfu | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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 |