Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent delete behavior between cp and rsync #157

Open
ViRb3 opened this issue May 11, 2021 · 1 comment
Open

Inconsistent delete behavior between cp and rsync #157

ViRb3 opened this issue May 11, 2021 · 1 comment

Comments

@ViRb3
Copy link

ViRb3 commented May 11, 2021

rsync will delete any files from $HDD_LOG that are no longer found in $RAM_LOG:

rsync -aXv --inplace --no-whole-file --delete-after "$RAM_LOG"/ "$HDD_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"

While cp will simply merge them:

cp -rfup "$RAM_LOG"/ -T "$HDD_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"

I'm not sure which behavior makes more sense, but it should definitely match between the two cases. I personally think merging is more useful since then I can configure my journald to only keep 50MB of logs, so it will delete old logs, but if log2ram already saved them to disk, they should not be overwritten.

@azlux
Copy link
Owner

azlux commented Aug 3, 2021

The rsync is the best here. The goal of log2ram is to copy from RAM to Disk.
cp command is here for fallback purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants