From 70837e7f5846ac149bbaa2d128fa3e4418ca52fb Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 26 Jan 2016 08:09:46 -0500 Subject: [PATCH] copy_puppet_logs: use SUDO to rename config/log files In a previous commit [1], we stopped changing the owner to manually set file mode bits. The problem is that 644 is not enough for files, because they need to be renamed so write permissions are needed. This patch aims to make sure files can be renamed by any user, so we use SUDO prefix for each 'mv' command. [1] I1c93a841b82514fb146d827332eecea98d9dbd3b Change-Id: I2ea4b090c99af33dd0095cbe664cd4187b114b54 --- jenkins/scripts/copy_puppet_logs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins/scripts/copy_puppet_logs.sh b/jenkins/scripts/copy_puppet_logs.sh index cb7e5fb6e2..ecb0a77cc5 100755 --- a/jenkins/scripts/copy_puppet_logs.sh +++ b/jenkins/scripts/copy_puppet_logs.sh @@ -181,13 +181,13 @@ done # append .txt to all config files # (there are some /etc/swift .builder and .ring files that get # caught up which aren't really text, don't worry about that) -find $LOG_DIR/sudoers.d $LOG_DIR/etc -type f -exec mv '{}' '{}'.txt \; +find $LOG_DIR/sudoers.d $LOG_DIR/etc -type f -exec sudo mv '{}' '{}'.txt \; # rabbitmq if [ -f $LOG_DIR/rabbitmq ]; then - find $LOG_DIR/rabbitmq -type f -exec mv '{}' '{}'.txt \; + find $LOG_DIR/rabbitmq -type f -exec sudo mv '{}' '{}'.txt \; for X in `find $LOG_DIR/rabbitmq -type f` ; do - mv "$X" "${X/@/_at_}" + sudo mv "$X" "${X/@/_at_}" done fi