prodrigestivill / docker-postgres-backup-local

Backup PostgresSQL to local filesystem with periodic backups and rotate backups.
https://hub.docker.com/r/prodrigestivill/postgres-backup-local
MIT License
760 stars 133 forks source link

Fail fast if symlinks not supported #145

Open janhoy opened 9 months ago

janhoy commented 9 months ago

I accidentally configured backups to a folder which was a SMB mount on my linyux box. And the backups ran, but of course at the end of the script it failed due to no symlink support:

[/home/sia/test](ln: failed to create symbolic link 'backups/last/sia-latest.sql.gz': Operation not supported)

It would be better if either

prodrigestivill commented 9 months ago

In the README are this requirements already exposed.

My undestanding is that the lastest symlink are meant to be readlink, but as a proposal it can be skipped if not supported by the filesystem.

janhoy commented 9 months ago

I see that it is documented. But you also see in Discussions section that people still accidentally run the script on other file systems. So making the script complain is a better user experience than having to guess. And falling back to not creating soft-links to "latest" or using hard-links for "latest" is also a better user experience than no support at all.