I’m trying my level best to reduce server space by deleting the unnecessary file and I come across with this file with huge space after running this command
[root$]# du -a / 2>/dev/null | sort -n -r | head -n 5
98926364 /
64453368 /var
63947356 /var/lib
63816012 /var/lib/pgsql
47322196 /var/lib/pgsql/db_log_archive
Does anyone know the importance of this file /var/lib/pgsql/db_log_archive in my centos 7 server ? I want to delete this
2
Answers
This is not a standard directory created by PostgreSQL on CentOS.
Check your postgresql.conf for any reference for this name if it is directly used by PostgreSQL (maybe for backing up WAL).
This is your WAL archive. I am not aware of CentOS 7 doing this automatically (but I’ve never used 7). Someone has probably gone out of their way to create this directory and then configure
archive_command
(frompostgresql.conf
) to copy WAL to it.If the person who set up your database is still around, you should ask them what their intentions were.
These could be part of a valid backup strategy. Or they could be part of an invalid backup strategy. Or they could be left over from a no-longer-used backup strategy. You would have to describe what your current backup system is for anyone to know.