tah Posted February 27, 2020 Share Posted February 27, 2020 Hello! I'm using this plugin but my script included CJK(Chinese japan, Korea) When saving the script in web ui the chinese char would be vanish Is there any bug or somthing? Thanks! CJK example: monthchi=("01-一月" "02-二月" "03-三月" "04-四月" "05-五月" "06-六月" "07-七月" "08-八月" "09-九月" "10-十月" "11-十一月" "12-十二月") would become monthchi=("01-" "02-" "03-" "04-" "05-" "06-" "07-" "08-" "09-" "10-" "11-" "12-") Quote Link to comment
Bruno Posted February 27, 2020 Share Posted February 27, 2020 (edited) Is there any variable that lets you know the original location of the script? Or the only option is to replace: /tmp/user.scripts/tmpScripts/YYY With /boot/config/plugins/user.scripts/scripts/YYY Edited February 27, 2020 by Bruno Quote Link to comment
Squid Posted February 27, 2020 Author Share Posted February 27, 2020 7 hours ago, tah said: Hello! I'm using this plugin but my script included CJK(Chinese japan, Korea) When saving the script in web ui the chinese char would be vanish Is there any bug or somthing? Thanks! CJK example: monthchi=("01-一月" "02-二月" "03-三月" "04-四月" "05-五月" "06-六月" "07-七月" "08-八月" "09-九月" "10-十月" "11-十一月" "12-十二月") would become monthchi=("01-" "02-" "03-" "04-" "05-" "06-" "07-" "08-" "09-" "10-" "11-" "12-") Due to various problems with people cutting and pasting from the forum, all characters except for ASCII are stripped from the scripts automatically. You're best saving your script elsewhere and use user.scripts to create a script to call the real one. Quote Link to comment
Squid Posted February 27, 2020 Author Share Posted February 27, 2020 5 hours ago, Bruno said: Is there any variable that lets you know the original location of the script? no Quote Link to comment
Squid Posted February 28, 2020 Author Share Posted February 28, 2020 OK, so now all schedules including Array Start and 1st boot only will start in the background. This does mean that if you have multiple scripts running on the same schedule then they will run concurrently. If this causes issues, you will have to redo your scripts so that #1 calls #2 calls #3 etc. Quote Link to comment
Zotarios Posted March 4, 2020 Share Posted March 4, 2020 Is there a way to start a screen through user scripts and bind it to tty pts/0? Quote Link to comment
Xaero Posted March 5, 2020 Share Posted March 5, 2020 On 2/27/2020 at 10:29 AM, Squid said: no On 2/27/2020 at 5:25 AM, Bruno said: Is there any variable that lets you know the original location of the script? Or the only option is to replace: /tmp/user.scripts/tmpScripts/YYY With /boot/config/plugins/user.scripts/scripts/YYY Try: #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" $DIR will then contain the folder the script was ran from. Quote Link to comment
Squid Posted March 5, 2020 Author Share Posted March 5, 2020 15 minutes ago, Xaero said: Try: #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" $DIR will then contain the folder the script was ran from. He was asking the original location of the script and not where its executed from. The original location is on the flash. But its processed and then executed from /tmp Quote Link to comment
Xaero Posted March 5, 2020 Share Posted March 5, 2020 35 minutes ago, Squid said: He was asking the original location of the script and not where its executed from. The original location is on the flash. But its processed and then executed from /tmp Oh, rip Quote Link to comment
54tgedrg45 Posted March 8, 2020 Share Posted March 8, 2020 (edited) Anyone also experiencing instant Firefox tab hang2crash after clicking script log of an in background running script? This happens when running rsync with quite some stdout. Currently running UR 6.8.3/ US 2020.02.27 / FF 73.0.1 Edited March 8, 2020 by 54tgedrg45 Quote Link to comment
Squid Posted March 8, 2020 Author Share Posted March 8, 2020 15 minutes ago, 54tgedrg45 said: Anyone also experiencing instant Firefox tab hang2crash after clicking script log of an in background running script? This happens when running rsync with quite some stdout. Currently running UR 6.8.3/ US 2020.02.27 / FF 73.0.1 If the log is insanely long, any browser will choke on it. Quote Link to comment
54tgedrg45 Posted March 8, 2020 Share Posted March 8, 2020 (edited) 22 minutes ago, Squid said: If the log is insanely long, any browser will choke on it. If so, is it somehow possible to just capture tail of log for the plugin to display within browser limits? Edited March 8, 2020 by 54tgedrg45 Quote Link to comment
Squid Posted March 8, 2020 Author Share Posted March 8, 2020 Command prompt Something akin to tail -f /tmp/user.scripts/tmpScripts/Set permissions on Downloads/log.txt Quote Link to comment
wsume99 Posted March 14, 2020 Share Posted March 14, 2020 I have a working script that I'm now trying to run every 2 minutes via cron. I selected the Custom option from the scheduled drop down menu and enter */2 * * * * as the Custom Cron Schedule value and then click on Run In Background. A pop-up window opens telling me the script is running in the background which I then close. I have modified my script temporarily to write entries into the log file every time it runs. I know the script runs once because I see the output in the log file but it but does not run again. My settings do not remain after reboot or even if I navigate away from the User Scripts management page and then come back. I'm not sure how to fix this issue. What am I doing wrong here?? Quote Link to comment
Squid Posted March 14, 2020 Author Share Posted March 14, 2020 You don't need to click run in background. All you have to do is set the cron and hit apply down at the bottom. As to why it's doing what it's doing no one can answer without seeing the exact script. Quote Link to comment
wsume99 Posted March 14, 2020 Share Posted March 14, 2020 50 minutes ago, Squid said: You don't need to click run in background. All you have to do is set the cron and hit apply down at the bottom. As to why it's doing what it's doing no one can answer without seeing the exact script. Thanks for the reply. The script was working just fine all I needed was to get it running in cron. I was clicking Run In Background instead of Apply. Once I used Apply it was loaded into Cron and persistent across a reboot. Everything is working just like I need now. Thank you Quote Link to comment
windlok1010 Posted March 25, 2020 Share Posted March 25, 2020 Is #noParity=true working on 6.8.2? My script still runs during parity check so I have to manually abort it. Quote Link to comment
Squid Posted March 25, 2020 Author Share Posted March 25, 2020 Send me a PM in a week to remind me to look at / fix Quote Link to comment
Zotarios Posted March 26, 2020 Share Posted March 26, 2020 Is there a way to purge or fix this plugin? I did broke it, don't know how, it lands me to a blank page even upon reinstalling it. Quote Link to comment
Squid Posted March 26, 2020 Author Share Posted March 26, 2020 Deleting the contents of /config/plugins/user.scripts on the flash drive followed by an uninstall then a reinstall will set it back to default. You will however loose your scripts. If you need to keep your scripts then dont delete the contents of the scripts folder Quote Link to comment
afon Posted March 27, 2020 Share Posted March 27, 2020 Hi, Squid. The pop-up argument input was fine, but after I upgraded the plugin. It's gone. Could you review my code? #!/bin/bash #description=Here is a housekeeping script. By default just deletes empty timestamp directories. Optionally, it can delete snapshots. foregroundOnly=true backgroundOnly=true #arrayStarted=false #name= BTRFS cleanup #argumentDescription="-a purges all snapshots; -i <Comma seperated list of shares> purges the selected shares. example -i Downloads,Test1,Test2 will purge all snapshots for Downloads, Test1, and Test2." #argumentDefault=-a shopt -s nullglob POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" case $key in -i|--include) INCLUDE="$2" shift # past argument shift # past value ;; -a|--all) ALL=YES shift ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters #Tokenize include list declare -A includes for token in ${INCLUDE//,/ }; do includes[$token]=1 done #iterate over all disks on array for disk in /mnt/disk*[0-9]* ; do #iterate over each timestamp for timestamp in ${disk}/.snapshots/* ; do #iterate over each share in the timestamp for snap in $timestamp/* ; do if [ -n "${includes[$(basename $snap)]}" ] || [ "$ALL" = "YES" ] ; then echo "Purging - $snap" btrfs subvolume delete $snap fi #check for empty timestamp if [ ! "$(ls -A $timestamp)" ] ; then echo "Purging empty directory - $timestamp" rmdir $timestamp fi done done done and it's original from Thank you so much. Quote Link to comment
Zotarios Posted March 27, 2020 Share Posted March 27, 2020 On 3/26/2020 at 10:52 AM, Squid said: Deleting the contents of /config/plugins/user.scripts on the flash drive followed by an uninstall then a reinstall will set it back to default. You will however loose your scripts. If you need to keep your scripts then dont delete the contents of the scripts folder Once deleted tryed to reinstall it, this happens: Removed and installed again, same behaviour. Quote Link to comment
Derek_ Posted March 28, 2020 Share Posted March 28, 2020 (edited) Are there any caveats to using email notification? I've got a user script that calls another script. Both scripts have an email notification and unRAID notification: Script email notification is to say something will start, or won't start based on conditions. If the conditions are met, it calls script2 (stored elsewhere) Script2 then does its thing and tells me whether or not its job was successful (that email notification works fine) unRAID UI notification works in all cases, and whether manually run or run through user.scripts UI. Email notification works for script2, but not script. The command before and the command after it work normally. I created a test script which had the exact same command (just the email command) and ran it via user.scripts UI and it worked - it sent an email... /usr/local/emhttp/webGui/scripts/notify -e "CronJob" -s "unRAID-backup >> STARTED <<" -d "$SCRIPT" -m "Logs :: $LOGFILE" -i "normal" Really weird. I can't figure it out. Note - when i ran manually for testing, the script was on the Array. I can't seem to manually run it from withing /boot/config/plugins/user.scripts/scripts/myscript. UPDATE: Oddly, several of my previous test runs have trickled through now. So while the script2 sent me an email more or less immediately, script dribbled them out between and hour or two after the script was run. Any ideas? Edited March 28, 2020 by Derek_ Quote Link to comment
Derek_ Posted March 29, 2020 Share Posted March 29, 2020 Another question: When i run Borg with a user.script - it performs its operations as root (as expected) and the dir/file ownership is root:root When i run and rsync copy with a user.script - it performs its operations as root (as expected) and the file ownership is with nobody:users. How come it differs? I'd like my Borg backups to be nobody:users too - but it looks like the only way i can do that is with chown. I can't run it as nobody can i? Quote Link to comment
uek2wooF Posted March 31, 2020 Share Posted March 31, 2020 What is the viewDockerLogSize script telling me exactly? The zoneminder log gets big pretty fast. It doesn't seem to be the same info you get from docker logs <container>. Can I move that log outside the container somehow? Thanks! 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.