nraygun Posted July 12, 2019 Share Posted July 12, 2019 It's wonky, but it gives me what I need. I created a FreeDOS VM and called it scripts. Inside of my borg backup script I start off with a "virsh start scripts" and then end the script with a "virsh destroy scripts". The scripts VM will show running when the borg script is in process and will show stopped when it's not. Close enough. Quote Link to comment
juan11perez Posted July 28, 2019 Share Posted July 28, 2019 Good day. appreciate some advice. Have been mounting rclone with the SpaceInvader tutorial for months; which runs the mount script at array start. After moving to Unraid 6.7 stable, this stopped working and on restart if the mount script runs, the array will not start. If I stop the script, the array starts and it's all good. Would welcome a suggestion to (automatically) run the mount script after the array starts as opposed to on array start. Thank you. Quote Link to comment
Chaos_Therum Posted August 8, 2019 Share Posted August 8, 2019 On 7/12/2019 at 4:08 PM, nraygun said: It's wonky, but it gives me what I need. I created a FreeDOS VM and called it scripts. Inside of my borg backup script I start off with a "virsh start scripts" and then end the script with a "virsh destroy scripts". The scripts VM will show running when the borg script is in process and will show stopped when it's not. Close enough. Not totally sure where I would start with something like this but you could probably code up a userscript to display a run status. I would have to imagine all this info is available to be displayed. Quote Link to comment
JorgeB Posted August 9, 2019 Share Posted August 9, 2019 I could probably google this but I wonder if someone can help, I want to make a user scrip append something to /etc/samba/smb-shares.conf and then reload samba conf, but just want to add it to the end of a specific share, in this case to the cache share (I have disk shares enable), turn this: [cache] path = /mnt/cache comment = browsable = yes # Public writeable = yes Into: [cache] path = /mnt/cache comment = browsable = yes # Public writeable = yes vfs objects = btrfs Quote Link to comment
JorgeB Posted August 9, 2019 Share Posted August 9, 2019 (edited) Should have just googled it, found a way of doing what I want, likely not very elegant but it works, problem now is that the script is not working when set to run at array start, I thought it might need a delay for the array to start and the smb-shares.conf to be created but added a "sleep 20" and it still doesn't work, it works if I run it manually after array start, any ideas? Edited August 9, 2019 by johnnie.black Quote Link to comment
JonathanM Posted August 9, 2019 Share Posted August 9, 2019 13 minutes ago, johnnie.black said: It works if I run it manually after array start, any ideas? Try firing your script with a simple at now script. #!/bin/bash echo "/boot/config/plugins/user.scripts/scripts/desired target script/script" | at now 1 Quote Link to comment
JorgeB Posted August 9, 2019 Share Posted August 9, 2019 7 minutes ago, jonathanm said: Try firing your script with a simple at now script. Nope 😪 Not even after starting the array and running that manually, so maybe I'm doing something wrong? The script works if I call it manually after array start, just not scheduled at array start. Quote Link to comment
JorgeB Posted August 9, 2019 Share Posted August 9, 2019 5 minutes ago, johnnie.black said: Not even after starting the array and running that manually, so maybe I'm doing something wrong? I was, apparently I can't have spaces in the name, I'll try again tomorrow since I'm out for the rest of the day. Quote Link to comment
JonathanM Posted August 9, 2019 Share Posted August 9, 2019 1 minute ago, johnnie.black said: Nope 😪 Not even after starting the array and running that manually, so maybe I'm doing something wrong? The script works if I call it manually after array start, just not scheduled at array start. Huh. I've never had a failure to fire using the at now technique. Maybe test your at now on a simple test script, like echo "Hi". Just to be clear, you unscheduled your end result script, and scheduled the at now script for array start? Maybe it's a combination of timing errors, and you really do need the short delay AND the at now handoff. The reason I use the at now is because I had a script that would hang the array if run at array start, but ran fine if I passed it off one level deep. Quote Link to comment
JonathanM Posted August 9, 2019 Share Posted August 9, 2019 1 minute ago, johnnie.black said: apparently I can't have spaces in the name Which part? In general I make it a habit not to use spaces whenever possible, I hate tracking down those type errors. Quote Link to comment
JorgeB Posted August 10, 2019 Share Posted August 10, 2019 (edited) 14 hours ago, jonathanm said: Try firing your script with a simple at now script. After escaping the space in the script folder name this worked, I still had to add the sleep command, like so: echo "sleep 30 ; /boot/config/plugins/user.scripts/scripts/desired target script/script" | at now I don't understand why the sleep command doesn't work in the original script, but as long as this works I don't care, thanks. Edited August 10, 2019 by johnnie.black Quote Link to comment
tmchow Posted August 13, 2019 Share Posted August 13, 2019 I have a user script that uses `wget` to download ffmpeg for use on my system. I have it setup to run "at first start of array". In watching the bootup procedure, the script runs but complains it can't resolve the host, and I think it's due to network connectivity not being available yet. The specific command I'm running is this: wget -qO- --show-progress --progress=bar:force:noscroll https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz -O //boot/custom/ffmpeg/ffmpeg-git-amd64-static.tar.xz Why wouldn't internet connectivity be available by the time the array is started? Is the solution to just add say a multi-minute sleep to the start of the script? Quote Link to comment
Squid Posted August 13, 2019 Author Share Posted August 13, 2019 4 minutes ago, tmchow said: Why wouldn't internet connectivity be available by the time the array is started? Sometimes depending upon NIC / router it is delayed Quote Link to comment
Squid Posted August 13, 2019 Author Share Posted August 13, 2019 5 minutes ago, tmchow said: Is the solution to just add say a multi-minute sleep to the start of the script? And you'd probably want to do something like echo wget -q0 .... | at NOW +5 min instead. That's off top of my head. You'll have to check the syntax of the at command Quote Link to comment
tmchow Posted August 15, 2019 Share Posted August 15, 2019 (edited) On 8/13/2019 at 11:32 AM, Squid said: And you'd probably want to do something like echo wget -q0 .... | at NOW +5 min instead. That's off top of my head. You'll have to check the syntax of the at command does this block execution of rest of script until that is run? If not, i think I'd have to either: 1. run a sleep command instead within the script 2. create another script that uses "at now" to call my existing script Edited August 15, 2019 by tmchow Quote Link to comment
Squid Posted August 17, 2019 Author Share Posted August 17, 2019 (edited) Because of ongoing issues from the IPS forum software which on occasion adds non-printable characters when copying code from the forum into user scripts' editing window, the editing window will now remove all characters over 0x7F when saving an edited script. This solves the problem of copying and then pasting code from the forum directly to the edit window on user scripts. This change will not affect the "code" itself, but may (or may not) affect the use of non-printable characters used in your echo statements. If this does happen your script will still run, but the characters used in the echos will be removed. If this happens, edit the script (/boot/config/plugin/user.scripts/.....) manually with your favourite text editor. This update will not affect any existing scripts. It will only affect the script when editing it. Edited August 17, 2019 by Squid Quote Link to comment
JonathanM Posted August 18, 2019 Share Posted August 18, 2019 22 hours ago, Squid said: This update will not affect any existing scripts. It will only affect the script when editing it. Wait, what? So if you edit an existing script, it will be affected? I'm guessing what you are saying is that until you open and save an existing script, the update doesn't change anything. Would it break things if instead of silently stripping the offending characters, remap the characters in the display to some visible character? What I'm getting at is instead of silently fixing the issue, make it obvious where the characters are, like maybe blink the space? That way if the unprintable is in a spot where it will break the script, the user can just delete it, if it's intentional you can still use the web editor without stripping them? Quote Link to comment
Squid Posted August 18, 2019 Author Share Posted August 18, 2019 (edited) 5 minutes ago, jonathanm said: Wait, what? So if you edit an existing script, it will be affected? Yeah. Catch-22. Non ascii characters will be removed. Personally, I doubt that any given script would ever have them in it. If any problems happen because of this, then I will re-address. In the meantime, this is the solution to copy / paste scripts from the forum. Edited August 18, 2019 by Squid Quote Link to comment
Semiconducted Posted August 18, 2019 Share Posted August 18, 2019 Probably a simple syntax issue, but I have tried every format and combination I could think of and still can't figure out how to sync between two shares on my local network. Setup:remote = Machine1 = unraid box with source media held in a SMB-shared user share "mc1media"local = Machine2 = unraid box running rclone, with disk share "mediasync" I don't see any errors, but any files I put in "mc1media/test" don't sync to "mediasync/test". Any help is GREATLY appreciated! The most recent scripts and results below. rclone.conf: [mediasync] type = local copy_links = true links = false Rclone Mount Script: #---------------------------------------------------------------------------- #!/bin/bash localshare="/mnt/disks/mediasync/test" remoteshare="//10.10.0.5/mnt/user/mc1media/test" mkdir -p $localshare # create local folder rclone mount -vv --max-read-ahead 1024k --allow-other $remoteshare $localshare & #---------------------------------------------------------------------------- LOG FILE: Script Starting Sun, 18 Aug 2019 15:36:33 -0400 Script Finished Sun, 18 Aug 2019 15:36:33 -0400 2019/08/18 15:36:33 DEBUG : rclone: Version "v1.48.0" starting with parameters ["rcloneorig" "--config" "/boot/config/plugins/rclone/.rclone.conf" "mount" "-vv" "--max-read-ahead" "1024k" "--allow-other" "//10.10.0.5/mnt/user/mc1media/test" "/mnt/disks/mediasync/test"] 2019/08/18 15:36:33 DEBUG : Using config file from "/boot/config/plugins/rclone/.rclone.conf" 2019/08/18 15:36:33 DEBUG : Local file system at /10.10.0.5/mnt/user/mc1media/test: Mounting on "/mnt/disks/mediasync/test" 2019/08/18 15:36:33 INFO : Local file system at /10.10.0.5/mnt/user/mc1media/test: poll-interval is not supported by this remote 2019/08/18 15:36:33 DEBUG : Adding path "vfs/forget" to remote control registry 2019/08/18 15:36:33 DEBUG : Adding path "vfs/refresh" to remote control registry 2019/08/18 15:36:33 DEBUG : Adding path "vfs/poll-interval" to remote control registry 2019/08/18 15:36:33 DEBUG : : Root: 2019/08/18 15:36:33 DEBUG : : >Root: node=/, err=<nil> Rclone Sync Script: #---------------------------------------------------------------------------- #!/bin/bash localshare="/mnt/disks/mediasync/test" remoteshare="//10.10.0.5/mnt/user/mc1media/test" rclone sync -vv $localshare $remoteshare #---------------------------------------------------------------------------- LOG FILE: Script Starting Sun, 18 Aug 2019 15:43:08 -0400 2019/08/18 15:43:09 DEBUG : rclone: Version "v1.48.0" starting with parameters ["rcloneorig" "--config" "/boot/config/plugins/rclone/.rclone.conf" "sync" "-vv" "/mnt/disks/mediasync/test" "//10.10.0.5/mnt/user/mc1media/test"] 2019/08/18 15:43:09 DEBUG : Using config file from "/boot/config/plugins/rclone/.rclone.conf" 2019/08/18 15:43:09 INFO : Local file system at /10.10.0.5/mnt/user/mc1media/test: Waiting for checks to finish 2019/08/18 15:43:09 INFO : Local file system at /10.10.0.5/mnt/user/mc1media/test: Waiting for transfers to finish 2019/08/18 15:43:09 INFO : Waiting for deletions to finish 2019/08/18 15:43:09 INFO : Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA - Errors: 0 Checks: 0 / 0, - Transferred: 0 / 0, - Elapsed time: 0s 2019/08/18 15:43:09 DEBUG : 3 go routines active 2019/08/18 15:43:09 DEBUG : rclone: Version "v1.48.0" finishing with parameters ["rcloneorig" "--config" "/boot/config/plugins/rclone/.rclone.conf" "sync" "-vv" "/mnt/disks/mediasync/test" "//10.10.0.5/mnt/user/mc1media/test"] Script Finished Sun, 18 Aug 2019 15:43:09 -0400 Quote Link to comment
Akuno Posted September 8, 2019 Share Posted September 8, 2019 Hi guys First let me thank you for the tool and support you provide. Now my question. I just made a script #!/bin/bash reboot and it works finde. Yeay! Now I want it to be sheduled every monday at 04:00 am how do i set the custom crone shedule? (what do i write in there?) Tahnks for your help Quote Link to comment
wgstarks Posted September 8, 2019 Share Posted September 8, 2019 1 hour ago, Akuno said: Hi guys First let me thank you for the tool and support you provide. Now my question. I just made a script #!/bin/bash reboot and it works finde. Yeay! Now I want it to be sheduled every monday at 04:00 am how do i set the custom crone shedule? (what do i write in there?) Tahnks for your help You can use the crontab generator- https://crontab-generator.org Quote Link to comment
Akuno Posted September 9, 2019 Share Posted September 9, 2019 (edited) On 9/9/2019 at 12:01 AM, wgstarks said: You can use the crontab generator- https://crontab-generator.org Tahnk you for the link. I got this out: 0 4 * * 1 reboot >/dev/null 2>&1 But I think I just need to set in the userscript the crone shedule to custom and write there >0 4 * * 1<. Am I right? Edited September 9, 2019 by Akuno Quote Link to comment
Squid Posted September 9, 2019 Author Share Posted September 9, 2019 30 minutes ago, Akuno said: 0 4 * * 1 This is what you enter in. 4 AM on Mondays Quote Link to comment
Akuno Posted September 10, 2019 Share Posted September 10, 2019 Thanks alot guys! 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.