Skip to content

Instantly share code, notes, and snippets.

@Nurlan199206
Created February 2, 2024 04:01
Show Gist options
  • Save Nurlan199206/31143776dbf62ac0a74179648ca2ef20 to your computer and use it in GitHub Desktop.
Save Nurlan199206/31143776dbf62ac0a74179648ca2ef20 to your computer and use it in GitHub Desktop.
patroni logrotate
/etc/logrotate.d/postgresql-common
/var/log/postgresql/*.log {
hourly
rotate 3
size 5M
compress
notifempty
missingok
nocreate
su root root
}
=====================================*/30 * * * * /bin/bash /root/remove_old.sh=======================================
#!/bin/bash
/usr/sbin/logrotate -f /etc/logrotate.d/postgresql-common
find /var/log/postgresql -name "*.log *.gz" -mtime 2 -exec rm -rf {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment