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

Ability to specify number of backup for each folders #77

Open mizzunet opened 2 years ago

mizzunet commented 2 years ago

This is my config,

WHATTOSYNC=('/home/missu/.mozilla/firefox')
USE_OVERLAYFS="yes"
USE_BACKUPS="yes"
BACKUP_LIMIT=2

I'd like to add ~/.cache/mozlla but do not want asd to take backup for this folder. Can I achieve this now? Would you be able to make it possible? So, the config to be like this,

WHATTOSYNC=('/home/missu/.mozilla/firefox'  '/home/missu/.cache/mozilla')
USE_OVERLAYFS="yes"
USE_BACKUPS="yes"
BACKUP_LIMIT=2
BACKUP_SECOND=0

As for now, a workaround is to, run two asd

manorit2001 commented 2 years ago

Right now it isn't possible, even I wanted to do it but some infrastructure change will be required to handle all this.

Adding BACKUP_SECOND is not really a good and scalable solution. My idea would be to allow users to install specific ASD configs from throughout the system by some asd install <config> command and the syncs will be handled by just one systemd instance of core-asd running in the system, It is just an idea and the feasibility of it is not tested at this stage.

Unfortunately, I don't have the bandwidth right now to work on it. If you'd be willing to work on this then I would be happy to review the PR. Otherwise, running two ASDs can work for the meanwhile as you said.

PS: If you are trying to sync the browser configs then I would suggest using profile-sync-daemon. I am not sure of its working but it is supposed to have some additional checks which are optimised for browser instances

graysky2 commented 2 years ago

If you are trying to sync the browser configs then I would suggest using profile-sync-daemon.

Agreed.

mizzunet commented 2 years ago

The reason I'm using asd over psd is that OpenRC is my init. I never have managed to get service file working properly. OpenRC can't have "user" service files.

While, asd is to be ran as root, it works perfectly for me.

mizzunet commented 2 years ago

Though, asd starts fine by openrc service

graysky2 commented 2 years ago

I honestly haven't reviewed asd's code base in a while. But psd definitely requires systemd.

manorit2001 commented 2 years ago

Both require systemd.

I think maybe he is not able to mimick the behaviour of systemctl --user in OpenRC. I am not sure exactly but psd is supposed to be started for each user and asd is supposed to work system-wide. Maybe that difference is causing troubles for him

manorit2001 commented 2 years ago

I honestly haven't reviewed asd's code base in a while. But psd definitely requires systemd.

asd also uses the same AFAIR, there is also some upstart config too but I haven't really used it

mizzunet commented 2 years ago

he is not able to mimick the behaviour of systemctl --user in OpenRC

It can't be. Someone has already requeted it, https://github.com/OpenRC/openrc/issues/432