#!/bin/bash ## Should be executable N time in a row with same result. . lib/common set -e uid=$(docker_get_uid "$SERVICE_NAME" "rsync") LOGS=/var/log/rsync mkdir -p "$SERVICE_DATASTORE/$LOGS" touch "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" chown -v "$uid" "$SERVICE_DATASTORE/$LOGS" "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" rotated_count=$(relation-get rotated-count 2>/dev/null) || true rotated_count=${rotated_count:-52} ## XXXvlab: a lot of this intelligence should be moved away into ``logrotate`` charm DST="$CONFIGSTORE/$TARGET_SERVICE_NAME/etc/logrotate.d/$SERVICE_NAME" file_put "$DST" <