![]() ![]() usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Unassigned Devices" -d "Error mounting device" -i "alert" ![]() usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Unassigned Devices" -d "Device unmounting" -i "normal" usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Unassigned Devices" -d "Device mounted" -i "normal"Įxecute python script <= your script Your UD device script will look like this: They don't do anything unless you add code, and your code will need to use the correct event.Ĭall your python script in the UD device script. Use the default script and don't remove any events. Set up your device script to do what you want when the device is plugged in. Ich hänge dazu mal ein Bild vom meinen User Scripts an. Einzige Bedingung: Stick bleibt immer stecken wie von Dir angegeben. Deine Anforderung läuft auf "Custom: 0 2 1 * *" hinaus. Die Hilfe hierzu ist auf der User Scripts Seite verlinkt. usr/local/sbin/rc.unassigned umount name=disknameĭanach noch Cron Einträge für dieses User Script setzen. # rsync -avPX -delete-during /mnt/user// /mnt/disks// # Hier machst Du was immer Du machen willst usr/local/sbin/rc.unassigned mount name=diskname Die Kommandos hierzu findest Du oben sowie in der Hilfe der Unassigned Devices Seite: Wäre das dann ein Device Script und wie würde es aussehen?įür diese Anforderung machst Du das mit dem User Script Plugin und nicht mit dem Device Script. ![]() des Monats um 02:00 mounten lasse und dann eben ein Backup Skript laufen lasse und wieder unmounte. # PROG_NAME - program name of this scriptįrage ich mich, ob und wenn ja, wie es geht, dass ich einen angeschlossenen USB-Stick automatisch bspw. ![]() # OWNER - "udev" if executed by UDEV, otherwise "user" # MOUNTPOINT - where the partition is mounted # LUKS - if the device is encrypted, this is the partition device, e.g. # UD_DEVICE - unassigned devX designation # ACTION - if mounting, ADD if unmounting, UNMOUNT if unmounted, REMOVE if error, ERROR_MOUNT, ERROR_UNMOUNT PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin Click on the three gears on the Historical device and click the "Attach" button and the device will then show up in UD. You need to use the complete 'Default' script and change the 'REMOVE' section. usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Unassigned Devices" -d "Device unmounted" -i "normal" usr/local/sbin/rc.unassigned detach $DEVICE # Detach the disk - uncomment this if you want the USB disk to be detached after it is unmounted usr/local/sbin/rc.unassigned spindown $DEVICE # Spin down disk - uncomment this if you want the disk to be spun down after the disk is unmounted You can have the disk detach by loading the default script in UD and uncomment the line to detach it: usr/local/sbin/rc.unassigned umount name=MusicBk Recycle.Bin '/mnt/user/Music' '/mnt/disks/Music Backup/' 2>&1 > $LOGFILE # Backup the Music folder to the backup disk usr/local/sbin/rc.unassigned mount name=MusicBk LOGFILE="/tmp/vices/logs/Music_Backup.log" I use this script to mount a disk, do a backup, and unmount the disk when it's done. What you want to do is to install the "User Scripts" plugin and set up a script to run at a set time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |