graysky2 / anything-sync-daemon

Symlinks and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
https://wiki.archlinux.org/index.php/Anything-sync-daemon
MIT License
345 stars 45 forks source link

No symlinks, is this the expected behavior ? #87

Closed LaMarMot closed 6 months ago

LaMarMot commented 7 months ago

Hey

So, I’m using anything-sync-daemon (asd) on Arch Linux (EndeavourOS install to be exact) and I’m just wondering if it’s working as it should.

I’m using it to manage the chromium cache directory.
It’s suppose to “move” this directory in tmpfs (i.e. in RAM) and synchronize it to the hard drive from time to time…

So when I “ask” it if everything is going according to plan, it seems to tell me “yes”:

$ asd p
Waiting for lock...
flock: getting lock took 0.000002 seconds
flock: executing /usr/bin/asd
Anything-sync-daemon v6.0.0 on EndeavourOS

 Systemd service is currently active.
 Systemd resync service is currently active.
 Overlayfs v23 is currently active.

Asd will manage the following per /run/asd.conf settings:

 owner/group id:     user/1000
 target to manage:   /home/user/.cache/chromium
 sync target:        /home/user/.cache/.chromium-backup_asd
 tmpfs target:       /tmp/asd-user/home/user/.cache/chromium
 dir size:           421M
 overlayfs size:     280K
 recovery dirs:      5 <- delete with the c option
  dir path/size:     /home/user/.cache/.chromium-backup_asd-crashrecovery-20240210_204103.tar.zstd (267M)
  dir path/size:     /home/user/.cache/.chromium-backup_asd-crashrecovery-20240128_121006.tar.zstd (4,0K)
  dir path/size:     /home/user/.cache/.chromium-backup_asd-crashrecovery-20240128_114248.tar.zstd (8,6M)
  dir path/size:     /home/user/.cache/.chromium-backup_asd-crashrecovery-20240116_191014.tar.zstd (298M)
  dir path/size:     /home/user/.cache/.chromium-backup_asd-crashrecovery-20240111_141324.tar.zstd (312M)

But if I look at the “managed” folder ( /home/user/.cache/chromium) it is still a “regular” directory, shouldn’t it rather be a symbolic link to /tmp/asd-user/home/user/.cache/chromium?

I’m using profile-sync-daemon (psd) to achieve the same behavior with my browsers profiles, and, in that case, the managed directories are (became) indeed symlinks to the directories in tmpfs…

Have I done something wrong or is asd working as it should (i.e. not writing cache on disk anymore, except to back it up)?

I would be very grateful for any advice :slight_smile:

Cheers !!

manorit2001 commented 6 months ago

Hi @LaMarMot , I think it's working as expected, you can actually see that the directory that you have would be a mountpoint actually and not a symlink, this change was made in asd with 6.0 version to make the user experience more transparent and help with the scenarios where asd crashes and restoration introduces a time gap that leads to the applications crashing.

LaMarMot commented 6 months ago

Hey @manorit2001, thanks a lot for your answer (and for your work by the way !).

I kind of remembered asd was using simlinks before (and is still referencing it in its description here by the way), and, as I'm not familiar with "bind mounting" (which I only discovered thanks to you :sweat_smile:) I then started to wonder what was wrong when I realize the directories weren't simlinks.

Thanks a lot for your reply and insights, much appreciated!