-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Preserve timestamps when copying log files #8930
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
Conversation
Add timestamp preservation when copying log files.
WalkthroughThe armbian-ramlog script's postrotate block now preserves source file timestamps on copied log files using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (1)
Comment |
Hey @N-Storm! 👋Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡 If you'd like to stay informed about project updates or collaborate more closely with the team, Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀 |
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
The
armbian-ramlogutility includes a postrotate action that copies log file contents from persistent storage ("HDD") to RAM usingcat source > dest. This approach was likely chosen to ensure compatibility with log files that remain open for writing.However, this method resets the file modification timestamp. While this typically has no impact on actively written log files, it can cause unwanted behavior for certain files in
/var/log. Any subsequent synchronization from RAM to persistent storage will propagate these altered timestamps.Ideally, the postrotate action could handle this more gracefully, but as a simple and non-invasive solution, this change adds a timestamp preservation step using
touch.How Has This Been Tested?
The change is very trivial. Nevertheless, I verified it on my Orange Pi One (
v25.8.2 for Orange Pi One running Armbian Linux 6.12.51-current-sunxi).Checklist:
Please delete options that are not relevant.
Summary by CodeRabbit