From ce5b0c57fadbb163fe33b14950815a06d674153e Mon Sep 17 00:00:00 2001 From: Erwan Miran Date: Wed, 8 Aug 2018 10:43:51 +0200 Subject: [PATCH] Empty /var/contiv/log ends up with cp: can't stat '/var/contiv/log/*': No such file or directory --- netplugin-init/common/001-migrate-log-location.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netplugin-init/common/001-migrate-log-location.sh b/netplugin-init/common/001-migrate-log-location.sh index 7a810d6..a3486fa 100755 --- a/netplugin-init/common/001-migrate-log-location.sh +++ b/netplugin-init/common/001-migrate-log-location.sh @@ -3,7 +3,7 @@ set -uex mkdir -p /opt/contiv/ /var/log/contiv -if [ -d /var/contiv/log ]; then +if [ -d /var/contiv/log ] && [ "$(ls -A /var/contiv/log)" ]; then # /var/contiv/log/ is deprecated, move all data to /var/log/contiv cp -a /var/contiv/log/* /var/log/contiv/ echo "INFO: Copied contiv log from /var/contiv/log (deprecated) to /var/log/contiv"