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
This commit is contained in:
parent
c1b98cd198
commit
70837e7f58
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user