Skip to content

Instantly share code, notes, and snippets.

@alphastorm
Created October 9, 2014 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphastorm/deb683220839cbe6b568 to your computer and use it in GitHub Desktop.
Save alphastorm/deb683220839cbe6b568 to your computer and use it in GitHub Desktop.
exec_cmd () {
# if [ $# -ne 1 ]; then
# echo "exec_cmd must be called with a command to execute."
# exit 1
# fi
echo "[`date +%Y-%m-%d:%H:%M:%S`] Executing command: ${1}"
${@}
EXIT_CODE=$?
if [ ${EXIT_CODE} -ne 0 ]; then
echo "Command exited with non-zero exit code: ${EXIT_CODE}"
fi
}
ssh ${BORG_UNAME}@${FETCHER_HOSTNAME} 'bash -s' < kill_job
so i wanna do
exec_cmd "ssh ${BORG_UNAME}@${FETCHER_HOSTNAME} 'bash -s' < kill_job"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment