docker-postgres-backup-local
docker-postgres-backup-local copied to clipboard
Fail fast if symlinks not supported
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
- Test a symlink and fail fast early with an error if filesystem not supported
- or skip making symlinks and print a warning
- or use hard-link for the "-latest" links
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.
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.