azlux / log2ram

ramlog like for systemd (Put log into a ram folder)
MIT License
2.64k stars 194 forks source link

rsync error : rsync: --sparse cannot be used with --inplace #230

Open PandaRoux8 opened 2 months ago

PandaRoux8 commented 2 months ago

Hello,

It seems like my rsync version is not compatible with log2ram.

When I run service log2ram reload it is supposed to write logs to disk. But instead I get the following error in /var/log/log2ram.log

rsync: --sparse cannot be used with --inplace
rsync error: syntax or usage error (code 1) at main.c(1585) [client=3.1.2]

Here's my rsync version

# rsync -v
rsync  version 3.1.2  protocol version 31

Apparently the support for both of these flag at the same time has been added in 3.1.3

Here's a few ideas :

  1. We set a flag in the config something like USE_RSYNC_LEGACY=false and change the rsync command if the flag is up
  2. We check the rsync version with a regex at runtime and change the rsync command if the flag is up
  3. You don't care about old rsync version and I make a fork of log2ram to support my old rsync :p

I will gladly make a pull requests, just want to know what you prefer. Or if you have any other idea

azlux commented 2 months ago

On this issue, any PR is welcome. In my opinion, I prefer the second option : checking the version and remove the flag if <3.1.3. Since this soft is made for debian/ubuntu, you can try to use dpkg --compare-versions to compare versions.