README angepasst
This commit is contained in:
+13
-32
@@ -1,7 +1,6 @@
|
|||||||
# 🧹 Temp Cleanup Script
|
# 🧹 Temp Cleanup Script
|
||||||
|
|
||||||
Dieses Repository enthält ein automatisiertes Cleanup-System für temporäre Dateien im Nextcloud-synchronisierten Dokumente-Ordner.
|
Dieses Repository enthält ein automatisiertes Cleanup-System für temporäre Dateien im durch Nextcloud synchronisierten Dokumente-Ordner.
|
||||||
|
|
||||||
Es entfernt automatisch Dateien und leere Ordner nach 30 Tagen und sorgt so für eine saubere, schlanke Synchronisationsstruktur.
|
Es entfernt automatisch Dateien und leere Ordner nach 30 Tagen und sorgt so für eine saubere, schlanke Synchronisationsstruktur.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -36,28 +35,18 @@ Der Service wird über **systemd (User oder System Service)** ausgeführt.
|
|||||||
|
|
||||||
## 📍 Installationspfade (Laptop)
|
## 📍 Installationspfade (Laptop)
|
||||||
|
|
||||||
### Script
|
Einfach auf einem neuen Laptop ausführen:
|
||||||
/home/kai/workstation-config/temp-cleanup/cleanup_temp.sh
|
|
||||||
|
|
||||||
### Service Datei (im Repo)
|
```bash
|
||||||
/home/kai/workstation-config/temp-cleanup/systemd/cleanup-temp.service
|
curl -s http://192.168.178.5:3000/kai/workstation-config/raw/branch/main/install.sh | bash
|
||||||
|
|
||||||
### Zielort für systemd (User Service)
|
|
||||||
~/.config/systemd/user/cleanup-temp.service
|
|
||||||
|
|
||||||
👉 Die Service-Datei muss bei Änderungen manuell kopiert werden.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# 🔄 Service Installation / Reload
|
# 🔄 Updates
|
||||||
|
|
||||||
Nach Änderungen der Service-Datei:
|
Das System aktualisiert sich über Git:
|
||||||
|
|
||||||
cp ~/workstation-config/temp-cleanup/systemd/cleanup-temp.service ~/.config/systemd/user/
|
curl -s http://192.168.178.5:3000/kai/workstation-config/raw/branch/main/install.sh | bash
|
||||||
systemctl --user daemon-reload
|
|
||||||
systemctl --user restart cleanup-temp.service
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# 🕒 Ausführungszeitpunkt
|
# 🕒 Ausführungszeitpunkt
|
||||||
|
|
||||||
@@ -85,23 +74,15 @@ Enthält:
|
|||||||
|
|
||||||
# 🧪 Manueller Test
|
# 🧪 Manueller Test
|
||||||
|
|
||||||
## Script direkt ausführen
|
# Testordner + alte Datei erzeugen
|
||||||
~/workstation-config/temp-cleanup/cleanup_temp.sh
|
mkdir -p ~/Dokumente/temp && \
|
||||||
|
|
||||||
## Testdateien erstellen (älter als 30 Tage simulieren)
|
|
||||||
mkdir -p ~/Dokumente/temp
|
|
||||||
touch -d "40 days ago" ~/Dokumente/temp/test_old_file.txt
|
touch -d "40 days ago" ~/Dokumente/temp/test_old_file.txt
|
||||||
|
|
||||||
## Testlauf starten
|
# Cleanup manuell ausführen
|
||||||
~/workstation-config/temp-cleanup/cleanup_temp.sh
|
bash ~/workstation-config/temp-cleanup/cleanup_temp.sh
|
||||||
|
|
||||||
## Ergebnis prüfen
|
# Ergebnis prüfen
|
||||||
ls -la ~/Dokumente/temp
|
ls ~/Dokumente/temp
|
||||||
cat ~/cleanup_temp.log
|
|
||||||
|
|
||||||
## Leere Ordner testen
|
|
||||||
mkdir -p ~/Dokumente/temp/old_folder
|
|
||||||
~/workstation-config/temp-cleanup/cleanup_temp.sh
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user