Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Add debug output --unison-verbose flag for background sync #4001

Merged
merged 1 commit into from
Feb 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions dockerfiles/mount/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ else
fi

UNISON_COMMAND="unison /mntssh /mnthost ${UNISON_ARGS}"
debug "Using command ${UNISON_COMMAND}"
if [ $(is_verbose "$@") = true ]; then
debug "Using command ${UNISON_COMMAND}"
fi

eval "${UNISON_COMMAND}"

Expand All @@ -158,5 +160,17 @@ info "INFO: (che mount): Background sync continues every ${UNISON_REPEAT_DELAY_I
info "INFO: (che mount): This terminal will block while the synchronization continues."
info "INFO: (che mount): To stop, issue a SIGTERM or SIGINT, usually CTRL-C."

if [ $(is_verbose "$@") = true ]; then
info "Background sync unison verbose mode"
UNISON_ARGS="-batch -retry 10 -fat -copyonconflict -auto -prefer=newer -repeat=${UNISON_REPEAT_DELAY_IN_SEC}"
else
UNISON_ARGS="-batch -retry 10 -fat -silent -copyonconflict -auto -prefer=newer -repeat=${UNISON_REPEAT_DELAY_IN_SEC} -log=false > /dev/null 2>&1"
fi

UNISON_COMMAND="unison /mntssh /mnthost ${UNISON_ARGS}"
if [ $(is_verbose "$@") = true ]; then
debug "Using command ${UNISON_COMMAND}"
fi

# run application
unison /mntssh /mnthost -batch -retry 10 -fat -silent -copyonconflict -auto -prefer=newer -repeat=${UNISON_REPEAT_DELAY_IN_SEC} -log=false > /dev/null 2>&1
eval "${UNISON_COMMAND}"