In an original attempt to make asd able to target directories that are mountpoints (where moving is impossible, thus leaving no room for symlinking), I ended up replacing completely the symlinking technique by bind mounts.
While this offers a number of advantages, it does come at a cost.
Pros :
The target directory never disappears from the file tree (cf. #37 )
The target directory can be a bind mount
In case asd is interrupted abruptly, the target directory is immediately usable in the state that the last sync left it
It is even more seemless for the system as well as for the user. (which may fix #19)
Cons :
It somehow breaks the backup feature (although I did my best to preserve it). Indeed, the backup directory is now a bind mount to the original inode of the filesystem, meaning that what is getting synced is the actual directory on disk. While this allows having a ready-to-work directory in case power failure or system crash without the need to restart asd, it prevents recovering the exact state it was left in at the time of the failure, for it could have changed before asd started again (which is very likely with directories like /var for example).
It still doesn't prevent data loss between the moment the original directory is duplicated in memory, and the moment the directory in memory gets bind mounted over the original directory.
Also, behaviour when using overlayfs needs testing (this and the use in conjunction with pacman), for I cannot test it myself, and therefore cannot guarantee it will work as expected.
In an original attempt to make asd able to target directories that are mountpoints (where moving is impossible, thus leaving no room for symlinking), I ended up replacing completely the symlinking technique by bind mounts. While this offers a number of advantages, it does come at a cost.
Pros :
Cons :
Also, behaviour when using overlayfs needs testing (this and the use in conjunction with pacman), for I cannot test it myself, and therefore cannot guarantee it will work as expected.