fork 0k-charms
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.

40 lines
810 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. services:
  26. $MASTER_TARGET_CHARM_NAME:
  27. volumes:
  28. - $DST:/etc/logrotate.d/docker-${SERVICE_NAME}:ro
  29. - $SERVICE_DATASTORE$LOGS:/var/log/docker/$SERVICE_NAME:rw
  30. $MASTER_BASE_CHARM_NAME:
  31. volumes:
  32. - $SERVICE_DATASTORE$LOGS:$LOGS:rw
  33. "