You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
808 B

  1. #!/bin/bash
  2. ## Should be executable N time in a row with same result.
  3. . lib/common
  4. set -e
  5. LOGS=/var/log/cron
  6. ## XXXvlab: a lot of this intelligence should be moved away into ``logrotate`` charm
  7. DST="$CONFIGSTORE/$TARGET_SERVICE_NAME/etc/logrotate.d/$SERVICE_NAME"
  8. file_put "$DST" <<EOF
  9. /var/log/docker/$SERVICE_NAME/*_script.log {
  10. weekly
  11. missingok
  12. dateext
  13. dateyesterday
  14. dateformat _%Y-%m-%d
  15. extension .log
  16. rotate 52
  17. compress
  18. delaycompress
  19. notifempty
  20. create 640 root root
  21. sharedscripts
  22. }
  23. EOF
  24. config-add "\
  25. $MASTER_TARGET_CHARM_NAME:
  26. volumes:
  27. - $DST:/etc/logrotate.d/docker-${SERVICE_NAME}:ro
  28. - $SERVICE_DATASTORE$LOGS:/var/log/docker/$SERVICE_NAME:rw
  29. "
  30. config-add "\
  31. $MASTER_BASE_CHARM_NAME:
  32. volumes:
  33. - $SERVICE_DATASTORE$LOGS:$LOGS:rw
  34. "