From b107f84c7555a494dccf72eba0ee0015391bc6db Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 16 Sep 2019 11:23:15 -0400 Subject: [PATCH] Do not try to copy crl-tmp contents if empty. The Kubernetes CronJob for syncing CRLs syncs them to a temporary folder and then copies them to the real location once the sync is complete. If the temporary folder is empty, the `cp` command throws an error. This updates the bash script that manages the sync so that it will skip the copy command if the temporary location is empty. --- script/sync-crls | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/sync-crls b/script/sync-crls index 6c33172e..f610680b 100755 --- a/script/sync-crls +++ b/script/sync-crls @@ -5,7 +5,8 @@ set -e cd "$(dirname "$0")/.." mkdir -p crl-tmp crls -# need to adjust this command ./.venv/bin/python ./atst/domain/authnid/crl/util.py crl-tmp crls -cp -r crl-tmp/* crls/ +if [ "$(ls -A crl-tmp)" ]; then + cp -r crl-tmp/* crls/ +fi rm -rf crl-tmp