Dump.sql file in the backup folder?

So I’ve been browsing my discourse folders and found a dump.sql file on the /backup folder that I don’t remember creating manually. I’d this a file that is automatically created during backups or am I having an intrusion?

It may have been left behind by a failed backup, perhaps if the disk filled during the backup. It’s not likely due to an intrusion.


I believe I’ve seen this kind of stuff several times and I also thought they were failed backups remnants.
Your explanation seems to confirm this. :+1:

Or not:

There must be a different reason, because the backup process creates a compressed dump.sql.gz file. Only a restore could leave a decompressed dump.sql file, but it should clean up after itself.

@Mr.X_Mr.X What’s the absolute path of the dump.sql file you’ve seen? And what’s the timestamp of the file? Could it be very old?



There was a dump.sql and a tar.gz typical archive. Nothing else, I’m storing backups on S3.

Unless compression fails?

In case the disk is nearly full, it’s a possibility.

1 Like

I’m pretty sure the file you are seeing was manually copied/uploaded and decompressed at that location. Backups use /var/www/discourse/tmp/backups/<name>/<timestamp> for storing the temporary dump.sql.gz file und restoring uses a completely different directory.

We are calling pg_dump with the --compress parameter, so it writes a compressed dump without a temporary file. Worst case, you’d see an incomplete dump.sql.gz file.