Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # location of the snapraid binary
  4. SNAPRAID_BIN="/usr/local/bin/snapraid"
  5.  
  6. # redirect all output to screen and file
  7. > $TMP_OUTPUT
  8. exec 3>&1 4>&2
  9. # NOTE: Not preferred format but valid: exec &> >(tee -ia "${TMP_OUTPUT}" )
  10. exec > >(tee -a "${TMP_OUTPUT}") 2>&1
  11.  
  12. # run the snapraid DIFF command
  13. echo "###SnapRAID DIFF [`date`]"
  14. $SNAPRAID_BIN diff
  15. # wait for the above cmd to finish
  16. wait
  17. echo
  18. echo "DIFF finished [`date`]"
  19.  
  20. exec {out}>&1 {err}>&2
  21. exec > >(tee -a output) 2>&1
  22. ...
  23. exec >&$out 2>&$err
  24. wait $(pgrep -P "$$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement