Compare commits
2
Commits
main
...
c64be0e9fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c64be0e9fa | ||
|
|
788c9f07b9 |
No files matched your search
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script runs the index process of PhotoPrism.
|
||||||
|
# it must be called from a cronjob or similar to ensure it runs periodically.
|
||||||
|
|
||||||
|
# Flag-Datei zur Vermeidung paralleler Ausführungen
|
||||||
|
FLAG_FILE="/root/photoprism-auto-index.flag"
|
||||||
|
|
||||||
|
# Cleanup-Funktion die IMMER ausgeführt wird (auch bei Fehlern/Abbruch)
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$FLAG_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# trap registriert die cleanup-Funktion für verschiedene Exit-Szenarien:
|
||||||
|
# EXIT = normales Script-Ende
|
||||||
|
# INT = CTRL+C (Signal 2)
|
||||||
|
# TERM = kill-Befehl (Signal 15)
|
||||||
|
# ERR = wenn ein Befehl fehlschlägt (bei set -e)
|
||||||
|
trap cleanup EXIT INT TERM ERR
|
||||||
|
|
||||||
|
# Prüfe ob ein anderer Prozess bereits läuft
|
||||||
|
if [ -f "$FLAG_FILE" ]; then
|
||||||
|
trap - EXIT INT TERM ERR
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Started: $(date '+%Y-%m-%d %H:%M:%S') | PID: $$" > "$FLAG_FILE"
|
||||||
|
|
||||||
|
# Führe Index-Prozess aus
|
||||||
|
docker exec ix-photoprism-photoprism-1 photoprism index
|
||||||
|
|
||||||
|
# Flag-Datei wird automatisch durch trap cleanup gelöscht
|
||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>com.backup-recordings-to-bfds</string>
|
||||||
|
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<string>/bin/bash</string>
|
||||||
|
<string>/Users/rob/code/lokale-scripte/macos/Backup-Recordings/backup-recordings-to-bfds.sh</string>
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<key>StartCalendarInterval</key>
|
||||||
|
<dict>
|
||||||
|
<key>Hour</key>
|
||||||
|
<integer>12</integer>
|
||||||
|
<key>Minute</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
|
||||||
|
<key>StandardOutPath</key>
|
||||||
|
<string>/Users/rob/code/lokale-scripte/macos/Backup-Recordings/run-backup-recordings_output.log</string>
|
||||||
|
<key>StandardErrorPath</key>
|
||||||
|
<string>/Users/rob/code/lokale-scripte/macos/Backup-Recordings/run-backup-recordings_error.log</string>
|
||||||
|
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Quelle und Ziel definieren
|
||||||
|
SOURCE="/Users/rob/Recordings/Work/"
|
||||||
|
TARGET="/Volumes/rob/recordings/Progress/Work/"
|
||||||
|
MOUNT_POINT="/Volumes/rob"
|
||||||
|
SERVER_ADDRESS="smb://bfds/rob"
|
||||||
|
|
||||||
|
# Prüfen, ob das Netzlaufwerk gemountet ist
|
||||||
|
if mount | grep -q "$MOUNT_POINT"; then
|
||||||
|
echo "Netzlaufwerk ist gemountet. Backup startet..."
|
||||||
|
else
|
||||||
|
echo "Netzlaufwerk nicht gefunden. Versuche zu mounten..."
|
||||||
|
osascript -e "mount volume \"$SERVER_ADDRESS\""
|
||||||
|
|
||||||
|
# Nach dem Mounten erneut prüfen
|
||||||
|
if mount | grep -q "$MOUNT_POINT"; then
|
||||||
|
echo "Netzlaufwerk erfolgreich gemountet."
|
||||||
|
else
|
||||||
|
echo "Fehler: Netzlaufwerk konnte nicht gemountet werden."
|
||||||
|
osascript -e 'display notification "Backup fehlgeschlagen! Netzlaufwerk nicht erreichbar." with title "Backup Script"'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Sicherung starten
|
||||||
|
rsync -v -r -l -t -D "$SOURCE" "$TARGET"
|
||||||
|
|
||||||
|
# -r → Rekursiv kopieren (alle Unterordner & Dateien)
|
||||||
|
# -l → Symbolische Links kopieren
|
||||||
|
# -t → Zeitstempel beibehalten
|
||||||
|
# -D → Geräte- und Sonderdateien kopiere
|
||||||
|
|
||||||
|
# Erfolgsmeldung ausgeben
|
||||||
|
echo "Backup abgeschlossen: $DATE"
|
||||||
|
|
||||||
|
# Optional: Notification für macOS anzeigen
|
||||||
|
osascript -e 'display notification "Backup abgeschlossen!" with title "Backup Script"'
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
Transfer starting: 2080 files
|
||||||
|
./00_MacOS/ErsterGitarrenTest/.DS_Store
|
||||||
|
./00_MacOS/Mobile Beats/.DS_Store
|
||||||
|
./00_MacOS/ReaperOnLinuxErsterTestt/.DS_Store
|
||||||
|
./00_MacOS/Vielleicht mal ein RMB Song/.DS_Store
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/00_MacOS/ErsterGitarrenTest/..DS_Store.bvPX7I" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/00_MacOS/Mobile Beats/..DS_Store.3IHOo3" failed: Operation not permitted (1)
|
||||||
|
rsync: failed to set times on "/Volumes/rob/recordings/Progress/Work/02_Windows/After Work - NY Video": Operation not permitted (1)
|
||||||
|
./00_MacOS/dance the break/.DS_Store
|
||||||
|
./01_Linux/DumDrumsV1/.DS_Store
|
||||||
|
./01_Linux/Maschienenraum/.DS_Store
|
||||||
|
./01_Linux/VN9J6C~K/.DS_Store
|
||||||
|
./01_Linux/YoutubeNachbauen/.DS_Store
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/00_MacOS/ReaperOnLinuxErsterTestt/..DS_Store.HZfDuM" failed: Operation not permitted (1)
|
||||||
|
./02_Windows/LMMS/.DS_Store
|
||||||
|
./02_Windows/MCSequencer-FirstTest/.DS_Store
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/00_MacOS/Vielleicht mal ein RMB Song/..DS_Store.ROkSo0" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/00_MacOS/dance the break/..DS_Store.aFBtuQ" failed: Operation not permitted (1)
|
||||||
|
rsync: failed to set times on "/Volumes/rob/recordings/Progress/Work/02_Windows/WakeMeUp": Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/01_Linux/DumDrumsV1/..DS_Store.yWjLTm" failed: Operation not permitted (1)
|
||||||
|
./03_LMMS/plugins/.DS_Store
|
||||||
|
./05_Midi/Groove Monkee Free MIDI GM/.DS_Store
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/01_Linux/Maschienenraum/..DS_Store.lnwOWK" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/01_Linux/VN9J6C~K/..DS_Store.q9CbtG" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/01_Linux/YoutubeNachbauen/..DS_Store.JnjLUb" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/02_Windows/LMMS/..DS_Store.iWwhBB" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/02_Windows/MCSequencer-FirstTest/..DS_Store.kuF708" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/03_LMMS/plugins/..DS_Store.GF6pRJ" failed: Operation not permitted (1)
|
||||||
|
rsync: mkstemp "/Volumes/rob/recordings/Progress/Work/05_Midi/Groove Monkee Free MIDI GM/..DS_Store.UerlTC" failed: Operation not permitted (1)
|
||||||
|
|
||||||
|
sent 258314 bytes received 318 bytes 7085 bytes/sec
|
||||||
|
total size is 646892330 speedup is 2501.21
|
||||||
|
rsync: failed to set times on "/Volumes/rob/recordings/Progress/Work/02_Windows/After Work - NY Video": Operation not permitted (1)
|
||||||
|
rsync: failed to set times on "/Volumes/rob/recordings/Progress/Work/02_Windows/WakeMeUp": Operation not permitted (1)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Netzlaufwerk ist gemountet. Backup startet...
|
||||||
|
Backup abgeschlossen:
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
Die *.plist datei definiert wann immer das cript startet (12Uhr täglich)
|
||||||
|
|
||||||
|
Die Befehle um das script in LaunchAgents einzufügen:
|
||||||
|
|
||||||
|
# Im Terminal benutzen
|
||||||
|
|
||||||
|
- wenn $(id -u) fehler wirft den aktuellen user id manuell eingeben. sollte 501 sein
|
||||||
|
- bootout löscht erstmal das alte zeug und bootstrap fügt es neu hinzu.
|
||||||
|
|
||||||
|
```
|
||||||
|
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.backup-recordings-to-bfds.plist
|
||||||
|
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.backup-recordings-to-bfds.plist
|
||||||
|
```
|
||||||
Reference in new issue
Block a user