Yes. In bash, check the exit status directly: if duplicacy backup; then curl "$CHECK_URL"; fi. If you need $?, compare with zero and keep spaces: if [ $? -eq 0 ]; then ...; fi. To report failure immediately, append || curl "$CHECK_URL/fail" to the backup command. Set CHECK_URL to your check’s ping address first. The earlier [ $? -lt 1] snippet is close but needs a space before ] and lowercase if.