Squid Posted May 22, 2018 Author Share Posted May 22, 2018 9 hours ago, skunkworker said: I'm running into a strange issue. When editing a script and then clicking "run in background" the newly edited script does not get run, but the older revision does. It took me touching the file in /tmp in order to get the script updated. Gimme a day or so I'll check it out Quote Link to comment
DZMM Posted June 16, 2018 Share Posted June 16, 2018 basic question - if I have a custom cron schedule and a task is still running from the last execution (e.g. backup job), will the script get run again or only if it's not already running? Thanks Quote Link to comment
Squid Posted June 16, 2018 Author Share Posted June 16, 2018 4 hours ago, DZMM said: basic question - if I have a custom cron schedule and a task is still running from the last execution (e.g. backup job), will the script get run again or only if it's not already running? Thanks It'll run a second instance. To have it avoid that, your script needs to check if its already running In pseudocode: if tempFile exists then exit create tempFile the actual script here remove tempFile 1 Quote Link to comment
DZMM Posted June 16, 2018 Share Posted June 16, 2018 26 minutes ago, Squid said: It'll run a second instance. To have it avoid that, your script needs to check if its already running In pseudocode: if tempFile exists then exit create tempFile the actual script here remove tempFile Very simple but effective - thank you. Quote Link to comment
Zetas Posted June 25, 2018 Share Posted June 25, 2018 I'm having an issue with user scripts where when I have a script set to run in the background and then abort it, it stays running. This is my script: #!/bin/bash #---------------------------------------------------------------------------- # This script mounts your remote share with the recommended options. | # Just define the remote you wish to mount as well as the local mountpoint. | # The script will create a folder at the mountpoint | #---------------------------------------------------------------------------- # Local mountpoint mntpoint="/mnt/disks/cloud" # It's recommended to mount your remote share in /mnt/disks/subfolder - # This is the only way to make it accesible to dockers # Remote share remoteshare="cache:" # If you want to share the root of your remote share you have to # define it as "remote:" eg. "acd:" or "gdrive:" home="/mnt/user/appdata/rclone" tmpupload="$home/tmp" #--------------------------------------------------------------------------------------------------------------------- mkdir -p $mntpoint mkdir -p $tmpupload rclone --allow-non-empty --allow-other mount $remoteshare $mntpoint --cache-db-path=$home --cache-tmp-upload-path=$tmpupload --cache-tmp-wait-time=30m -vv And after "aborting" the script using the userscripts button this is what `ps auxw |grep rclone` says on the system: root 3230 0.0 0.0 9812 2044 pts/0 S+ 13:48 0:00 grep rclone root 27063 0.0 0.0 11956 2908 ? SN 12:48 0:00 /bin/bash /tmp/user.scripts/tmpScripts/rclone_mount_plugin/script root 27066 0.0 0.0 11960 2908 ? SN 12:48 0:00 /bin/bash /usr/sbin/rclone --allow-non-empty --allow-other mount cache: /mnt/disks/cloud --cache-db-path=/mnt/user/appdata/rclone --cache-tmp-upload-path=/mnt/user/appdata/rclone/tmp --cache-tmp-wait-time=30m -vv root 27068 0.8 0.2 155556 66464 ? SNl 12:48 0:31 rcloneorig --config /boot/config/plugins/rclone/.rclone.conf --allow-non-empty --allow-other mount cache: /mnt/disks/cloud --cache-db-path=/mnt/user/appdata/rclone --cache-tmp-upload-path=/mnt/user/appdata/rclone/tmp --cache-tmp-wait-time=30m -vv This same behavior is apparent in my plexdrive backgrounded script also. After aborting it still stays running. Am I doing something wrong here? 1 Quote Link to comment
Squid Posted June 25, 2018 Author Share Posted June 25, 2018 Any long running commands do not get aborted. You want the user script to start the "real" script in the background by doing something likeecho "pathToScrip" | at NOW -mSent via Tapatalk because I'm either at work or enjoying the summer 1 Quote Link to comment
Zetas Posted June 25, 2018 Share Posted June 25, 2018 Ok, so I should fire off the mount with a subscript. And I suppose use a different script with a "killall rclone" or something like that? Not as elegant as I was hoping for but as long as I can make it work it's fine. I am curious to know why the abort button doesn't actually abort the script. It doesn't seem like it's very useful. If you set a script to "run in the background" it seems reasonable to assume the abort button will cancel that script. Right now it seems like it does nothing. Quote Link to comment
endiz Posted June 27, 2018 Share Posted June 27, 2018 I had to fresh install unraid.. after installing user scripts it seems like the icon is missing.. anyone else experiencing this issue? Quote Link to comment
Squid Posted June 27, 2018 Author Share Posted June 27, 2018 1 hour ago, endiz said: I had to fresh install unraid.. after installing user scripts it seems like the icon is missing.. anyone else experiencing this issue? IDK Looks like something went wrong for some reason on install. I just did a fresh one and there's no problem with the icon Quote Link to comment
vanes Posted July 2, 2018 Share Posted July 2, 2018 Hi guys, i need some help. I am trying to run custom cron of my scrub scripts, but recieve this: unRaid crond[1825]: exit status 127 from user root * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Scrubc/script > /dev/null 2>&1 my script is: (\config\plugins\user.scripts\scripts\Scrubc\script) #!/bin/bash /usr/local/emhttp/plugins/dynamix/scripts/notify -e "start_scrub_cache" -s "Scrub cache drive" -d "Scrub of cache drive started" -i "normal" -m "Scrubbing message" btrfs scrub start -rdB /mnt/cache > /boot/logs/scrub_cache.log if [ $? -eq 0 ] then /usr/local/emhttp/plugins/dynamix/scripts/notify -e "start_scrub_cache" -s "Scrub cache drive" -d "Scrub of cache drive finished" -i "normal" -m /boot/logs/scrub_cache.log else /usr/local/emhttp/plugins/dynamix/scripts/notify -e "start_scrub_cache" -s "Scrub cache drive" -d "Error in scrub of cache drive !" -i "alert" -m /boot/logs/scrub_cache.log fi Run/Run in Background works fine. Custom cron - dont. Quote Link to comment
itimpi Posted July 2, 2018 Share Posted July 2, 2018 (edited) That screenshot suggests you have 6 fields in the custom entry. On my system I only use 5 fields and custom cron jobs run fine. Not sure if this matters but thought it worth mentioning. Edited July 2, 2018 by itimpi 1 Quote Link to comment
vanes Posted July 2, 2018 Share Posted July 2, 2018 (edited) 10 hours ago, itimpi said: you have 6 fields in the custom entry Thank you so much for watching, man. I fixed it to 5 fields, I'll see how it works, I'll write it helped or not ? I'm almost sure that the reason for this P.S. Thanks, @itimpi , Problem solved! Edited July 2, 2018 by vanes Quote Link to comment
RoninTech Posted July 12, 2018 Share Posted July 12, 2018 Thank you for this plugin! Is there a way to access a "Run Script" button via a URL? Would love to add links on our phones that we can trigger with a single press rather than opening a browser, going to the user scripts page and then pressing one. Quote Link to comment
DZMM Posted July 12, 2018 Share Posted July 12, 2018 I've added a /scripts pointing to /boot/config/plugins/user.scripts/scripts/ in radarr and sonarr to run a couple of my scripts. Do I need to do anything funky like RO/Slave etc, or just leave it as Read/Write? Thanks Quote Link to comment
Squid Posted July 12, 2018 Author Share Posted July 12, 2018 Nope. /boot isn't an unassigned device, so you can just leave it at RW. Not that RW:Slave causes any problems though. Quote Link to comment
DZMM Posted July 12, 2018 Share Posted July 12, 2018 41 minutes ago, Squid said: Nope. /boot isn't an unassigned device, so you can just leave it at RW. Not that RW:Slave causes any problems though. Thanks Quote Link to comment
MasterMark Posted July 14, 2018 Share Posted July 14, 2018 Hi, I need to use expect for SSH connection, but it is not installed on unRAID by default. I am trying similar code like this: #!/usr/bin/expect -f spawn ssh [email protected] "ls /file" expect "password:" send "mypassword\r" Do anyone have any idea how can I install expect to unRAID? Thanks, Mark Quote Link to comment
wgstarks Posted July 14, 2018 Share Posted July 14, 2018 1 hour ago, MasterMark said: Do anyone have any idea how can I install expect to unRAID? Expect is included in nerd tools. 1 Quote Link to comment
MasterMark Posted July 14, 2018 Share Posted July 14, 2018 11 hours ago, wgstarks said: Expect is included in nerd tools. Oh, I totally forgot nerd tools. Thanks a lot. Quote Link to comment
vw-kombi Posted July 22, 2018 Share Posted July 22, 2018 hopefully a simple request for you linuxy experts. I have the rclone custom script running to send CCTV footage of alerts to my gdrive. The script runs minimum 1 hour in user scripts - in which time the thief may have found my unraid system and nicked it too.... The 'custom' allows for a cron type input. What can I put in there for every 5 minutes ? Quote Link to comment
MasterMark Posted July 23, 2018 Share Posted July 23, 2018 3 hours ago, vw-kombi said: hopefully a simple request for you linuxy experts. I have the rclone custom script running to send CCTV footage of alerts to my gdrive. The script runs minimum 1 hour in user scripts - in which time the thief may have found my unraid system and nicked it too.... The 'custom' allows for a cron type input. What can I put in there for every 5 minutes ? */5 * * * * Quote Link to comment
NewDisplayName Posted July 23, 2018 Share Posted July 23, 2018 (edited) I installed a new usb drive, bc the old was failing from time to time. I have CA Backup thingy. (but i cant find my scripts, only the preinstaleld scriptps got backed up ? ) Yesterday i set everything up, urrently i let a parity run. I thought all is fine, but sadly all my custom scripts are lost... how to backup them? Edited July 23, 2018 by nuhll Quote Link to comment
trurl Posted July 23, 2018 Share Posted July 23, 2018 You can download a complete zipped backup of your flash drive at Main - Boot Device - Flash - Flash backup Quote Link to comment
Squid Posted July 23, 2018 Author Share Posted July 23, 2018 11 hours ago, nuhll said: I have CA Backup thingy. (but i cant find my scripts, only the preinstaleld scriptps got backed up ? ) They would all be in the destination you set for USB backup... config/plugins/user.scripts/scripts Quote Link to comment
NewDisplayName Posted July 24, 2018 Share Posted July 24, 2018 I dont know why, but there are only the standard scripts... or... does it have a bug and cant backup ö ä ü ß ? Quote Link to comment
Recommended Posts
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.