Advertisement
yaneurabeya

Untitled

Feb 8th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Index: nanobsd/Files/usr/local/sbin/scrub
  2. ===================================================================
  3. --- nanobsd/Files/usr/local/sbin/scrub (revision 10055)
  4. +++ nanobsd/Files/usr/local/sbin/scrub (working copy)
  5. @@ -35,7 +35,7 @@
  6. {
  7.  
  8. cat<<-__EOF__
  9. - usage: $0 -p <pool> [<options>]
  10. + usage: $0 [<options>] pool
  11. Where options is:
  12. -t Threshold days between scrubs
  13. __EOF__
  14. @@ -50,12 +50,9 @@
  15. local rc=0
  16. local _last_scrub _scrub_diff _status pool
  17.  
  18. - while getopts "p:t:" opt
  19. + while getopts "t:" opt
  20. do
  21. case "${opt}" in
  22. - p)
  23. - pool=${OPTARG}
  24. - ;;
  25. t)
  26. threshold=${OPTARG}
  27. ;;
  28. @@ -66,11 +63,15 @@
  29. esac
  30. done
  31.  
  32. - if [ -z "${pool}" ]; then
  33. + shift $(( $OPTIND - 1 ))
  34. +
  35. + if [ $# -ne 1 ]; then
  36. usage "${opts}"
  37. return 2
  38. fi
  39.  
  40. + pool=$1
  41. +
  42. # Piece of code based on 800.scrub-zfs from periodic
  43. _last_scrub=$(zpool history ${pool} | \
  44. egrep "^[0-9\.\:\-]{19} zpool scrub ${pool}\$" | tail -1 |\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement