Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # location of the snapraid binary
- SNAPRAID_BIN="/usr/local/bin/snapraid"
- # redirect all output to screen and file
- > $TMP_OUTPUT
- exec 3>&1 4>&2
- # NOTE: Not preferred format but valid: exec &> >(tee -ia "${TMP_OUTPUT}" )
- exec > >(tee -a "${TMP_OUTPUT}") 2>&1
- # run the snapraid DIFF command
- echo "###SnapRAID DIFF [`date`]"
- $SNAPRAID_BIN diff
- # wait for the above cmd to finish
- wait
- echo
- echo "DIFF finished [`date`]"
- exec {out}>&1 {err}>&2
- exec > >(tee -a output) 2>&1
- ...
- exec >&$out 2>&$err
- wait $(pgrep -P "$$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement