azlux / log2ram

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

Restore RSYNC for backwards compatibility #182

Closed twojstaryzdomu closed 2 years ago

twojstaryzdomu commented 2 years ago

This PR restores the ability to use cp instead of rsync for syncing files between the disk and the RAM. The parameter USE_RSYNC that controlled whether rsync is used was removed in 1.6.1.

Any parameter changes need to respect the former config default of USE_RSYNC=false. Many users won't knowingly agree to configuration file changes that remove a parameter that gave them a greater set of choices.

The restored parameter is intentionally commented out, respecting the removal of the parameter in post 1.6.1 log2ram.conf that defaulted to rsync for file transfers when installed. The default from pre 1.6.1 log2ram.conf, that is USE_RSYNC=false, is honoured.

Now rsync runs whenever USE_RSYNC is unset or missing (post 1.6.1 default in log2ram.conf) or set to true (case sensitive). cp is run for all other cases: when USE_RSYNC set to false (pre 1.6.1 default) or anything else, as well as when rsync isn't installed.