You've already forked journal-log-ubuntu
docs: clearer README, more user-friendly
This commit is contained in:
72
README.md
72
README.md
@@ -1,37 +1,79 @@
|
||||
# Clear Journal Log for Ubuntu 24.04 Server
|
||||
# Journal Log Auto-Cleanup for Ubuntu 24.04 Server
|
||||
[](#)
|
||||
[](#)
|
||||
[](#)
|
||||
[](./LICENSE)
|
||||
|
||||
Automated Bash installer script for configuring **journal log cleanup** on Ubuntu 24.04 Server.
|
||||
Automated Bash installer for **journal log rotation and cleanup** on Ubuntu 24.04 Server.
|
||||
|
||||
This script automatically cleans up **journalctl** once a week, retaining logs for **3 days**.
|
||||
This script configures a scheduled **weekly cleanup of journalctl logs**, keeping the last **3 days** of system logs — enough for debugging without filling storage.
|
||||
|
||||
### Download the Script
|
||||
Clone the repository from your Git server:
|
||||
Fire-and-forget. Install once, logs stay under control forever.
|
||||
|
||||
---
|
||||
|
||||
## 1. Download
|
||||
|
||||
```
|
||||
git clone https://git.x-files.dk/server/journal-log-ubuntu.git
|
||||
```
|
||||
|
||||
```
|
||||
cd journal-log-ubuntu
|
||||
```
|
||||
|
||||
### Usage
|
||||
Run the script using:
|
||||
---
|
||||
|
||||
## 2. Install
|
||||
|
||||
```
|
||||
cd journal-log-ubuntu
|
||||
sudo ./journal-log-ubuntu
|
||||
```
|
||||
|
||||
### Notes
|
||||
A crontab entry will be added to perform cleanup of **journalctl** logs. This job runs every **Sunday at 02:00**.
|
||||
This creates a cron-executed cleanup script at:
|
||||
|
||||
### Post-install
|
||||
Nothing to do.
|
||||
```
|
||||
/usr/local/bin/clear-journal-log
|
||||
```
|
||||
|
||||
and registers a weekly schedule under:
|
||||
|
||||
```
|
||||
/etc/cron.d/clear-journal-log
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Schedule Details
|
||||
|
||||
Cleanup runs automatically:
|
||||
|
||||
| Action | When |
|
||||
|---|---|
|
||||
| Journal rotation + vacuum | Every Sunday @ 02:00 |
|
||||
| Log retention window | 3 days |
|
||||
| Output log | `/var/log/clear-journal.log` |
|
||||
|
||||
You don't need to add cron jobs — installer handles everything.
|
||||
|
||||
---
|
||||
|
||||
## 4. Verify Log Rotation
|
||||
|
||||
Check last run:
|
||||
|
||||
```
|
||||
cat /var/log/clear-journal.log
|
||||
```
|
||||
|
||||
You should see:
|
||||
|
||||
✔ size before cleanup
|
||||
✔ size after cleanup
|
||||
✔ timestamped header + footer
|
||||
|
||||
---
|
||||
|
||||
### Post-Install
|
||||
|
||||
Nothing else required — scheduling is automatic.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user