Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wie inotify verwenden?

Featured Replies

Hi zusammen,

ich würde gerne ein Script ausführen, sobald in einem Ordner neue Dateien erscheinen. Es soll über den Ordner selbst und entsprechende Unterordner wachen. Das Script ist folgendens:

#!/bin/bash

# Directory to monitor
MONITOR_DIR="/path/to/your/directory"

# Action to perform when a new .txt file appears
handle_new_file() {
    NEW_FILE="$1"
    
    # Get the base filename without the path
    BASE_NAME=$(basename "$NEW_FILE")
    
    # Create the new filename with .original extension in the same directory
    NEW_FILENAME="${NEW_FILE}.original"
    
    # Write the base filename to the new file
    echo "$BASE_NAME" > "$NEW_FILENAME"
    
    # Log the action
    echo "New .txt file detected: $NEW_FILE, created $NEW_FILENAME" >> /path/to/your/logfile.log
}

# Start monitoring for new .mkv files recursively
inotifywait -m -r -e create --format '%w%f' "$MONITOR_DIR" | while read NEWFILE
do
    # Check if the new file is an .txt file
    if [[ "$NEWFILE" == *.txt ]]; then
        handle_new_file "$NEWFILE"
    fi
done

 

wie binde ich das jetzt unter unraid ein? Über User scripts würde es ja nicht passen, da ich dort ein schedule angeben muss, oder? Falls doch, welchen schedule muss ich da eintragen?

 

Besten Gruß

Edited by pille

Solved by alturismo

10 hours ago, pille said:

welchen schedule muss ich da eintragen?

on array start beispielsweise ...

  • Author
17 hours ago, alturismo said:

on array start beispielsweise ...

Ah perfekt. Und dann einfach ganz normal unter userscripts eintragen, also?

  • Solution
6 hours ago, pille said:

Ah perfekt. Und dann einfach ganz normal unter userscripts eintragen, also?

ja

  • 1 year later...

inotify finde ich nur als docker app in den CA (inotify-command). Geht das nur mit docker. Früher gab es wohl auch ein Plugin Nerdpack/Nerdtools?

Nutzt du für dein Script die docker app?

3 hours ago, PinkCarlos said:

Nutzt du für dein Script die docker app?

es sollte doch onboard sein ... gib mal im terminal inotifywait ein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.