wgstarks Posted January 17, 2019 Share Posted January 17, 2019 3 minutes ago, scubieman said: dont see it Scroll down some more. Quote Link to comment
scubieman Posted January 17, 2019 Share Posted January 17, 2019 You see by the scroll bar I am to the bottom. Quote Link to comment
Squid Posted January 17, 2019 Author Share Posted January 17, 2019 You need to install the dynamix Schedules plugin to be able to adjust the Daily/Weekly/Monthly times 2 Quote Link to comment
scubieman Posted January 17, 2019 Share Posted January 17, 2019 2 minutes ago, Squid said: You need to install the dynamix Schedules plugin to be able to adjust the Daily/Weekly/Monthly times That works better. Thank you! Quote Link to comment
DZMM Posted January 26, 2019 Share Posted January 26, 2019 (edited) Edit: Ignore - found a better way of tackling my problem Can I get some help from someone more knowledgeable than me please. What I want to do is check if a directory on my array is larger than 100GB e.g. check if /mnt/user0/downloads/nzbget is larger than 100GB. The reason I want to do this is if I can work out how to do the check, if positive I'll pause my downloads as I'm finding that if mover moves too many files to the array before they are added to the right directory I start suffering IO meltdown. Thanks in advance. Edited January 26, 2019 by DZMM Quote Link to comment
trurl Posted January 26, 2019 Share Posted January 26, 2019 7 minutes ago, DZMM said: Can I get some help from someone more knowledgeable than me please. What I want to do is check if a directory on my array is larger than 100GB e.g. check if /mnt/user0/downloads/nzbget is larger than 100GB. The reason I want to do this is if I can work out how to do the check, if positive I'll pause my downloads as I'm finding that if mover moves too many files to the array before they are added to the right directory I start suffering IO meltdown. Thanks in advance. du -sh /mnt/user0/downloads/nzbget Quote Link to comment
DZMM Posted January 26, 2019 Share Posted January 26, 2019 40 minutes ago, trurl said: du -sh /mnt/user0/downloads/nzbget Thanks I know how to get the size, but how do I do the if bigger than 100GB then.... bit? Quote Link to comment
CraigGivant Posted January 28, 2019 Share Posted January 28, 2019 I'm trying to run the VM Config Backup script and receiving the errors in the code box below. The path that is to be used and was added to the config file is: /mnt/user/030 - IT Support/Backup Data/Unraid/VM Settings I pretty sure this is an issue with the spaces and/or the dash in the path name but I have tried a bunch of different syntax including single quotes, backslashes to remove the spaces, etc. Just cant seem to get it right. Can anybody assist with how this path should be defined in the config? Thanks! Script location: /tmp/user.scripts/tmpScripts/vm settings backup/script Note that closing this window will abort the execution of this script /tmp/user.scripts/tmpScripts/vm settings backup/script: line 10: [: too many arguments As /mnt/user/030 - IT Support/Backup Data/Unraid/VM Settings//vmsettings/_27_Jan_2019 exists continuing. Saving vm xml files rsync: link_stat "/mnt/user/030" failed: No such file or directory (2) rsync: link_stat "/-" failed: No such file or directory (2) rsync: link_stat "/IT" failed: No such file or directory (2) rsync: change_dir "/Support" failed: No such file or directory (2) rsync: change_dir "/Data/Unraid" failed: No such file or directory (2) rsync: mkdir "/Settings//vmsettings/_27_Jan_2019/xml" failed: No such file or directory (2) rsync error: error in file IO (code 11) at main.c(664) [Receiver=3.1.3] Saving ovmf nvram rsync: link_stat "/mnt/user/030" failed: No such file or directory (2) rsync: link_stat "/-" failed: No such file or directory (2) rsync: link_stat "/IT" failed: No such file or directory (2) rsync: change_dir "/Support" failed: No such file or directory (2) rsync: change_dir "/Data/Unraid" failed: No such file or directory (2) rsync: mkdir "/Settings//vmsettings/_27_Jan_2019/nvram" failed: No such file or directory (2) rsync error: error in file IO (code 11) at main.c(664) [Receiver=3.1.3] chmod: cannot access '/mnt/user/030': No such file or directory chmod: cannot access '-': No such file or directory chmod: cannot access 'IT': No such file or directory chmod: cannot access 'Support/Backup': No such file or directory chmod: cannot access 'Data/Unraid/VM': No such file or directory chmod: cannot access 'Settings//vmsettings/_27_Jan_2019': No such file or directory Quote Link to comment
trurl Posted January 28, 2019 Share Posted January 28, 2019 48 minutes ago, CraigGivant said: I'm trying to run the VM Config Backup script and receiving the errors in the code box below. The path that is to be used and was added to the config file is: /mnt/user/030 - IT Support/Backup Data/Unraid/VM Settings I pretty sure this is an issue with the spaces and/or the dash in the path name but I have tried a bunch of different syntax including single quotes, backslashes to remove the spaces, etc. Just cant seem to get it right. Can anybody assist with how this path should be defined in the config? Personally I wouldn't put spaces in a user share name just to avoid these sorts of problems. Quote Link to comment
CraigGivant Posted January 28, 2019 Share Posted January 28, 2019 18 minutes ago, trurl said: Personally I wouldn't put spaces in a user share name just to avoid these sorts of problems. I can appreciate that but the horse has already left the barn. I also believe this not only affects the share name but also the folders within the share. I migrated all data over from a Qnap and literally have thousands of folders. I certainly don't want to rename them all as even if there was a script to do this easily we have too many programs that would need to be re-pathed to find their data. I have had no issues with anything (including VM's and Dockers) using paths with spaces. I have only encounters it in this plugin as per above as well as with spaceinvaders icon pack downloader. Hoping for a simple way to define this path properly to work with the scripts and if not I'll just have to create a different share. Quote Link to comment
CraigGivant Posted January 31, 2019 Share Posted January 31, 2019 I got this to work but not as eloquently as the original script. Once I figured out the path syntax, nothing I did would pass the backuplocation variable properly to the rest of the script. I removed the variable and directly entered the path in all instance of $dir. Here is what worked: #!/bin/bash #backs up datestamp="_"`date '+%d_%b_%Y'` mkdir -vp '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/nvram' mkdir -vp '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/xml' echo "Saving vm xml files" rsync -a --no-o /etc/libvirt/qemu/*xml '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/xml' echo "Saving ovmf nvram" rsync -a --no-o /etc/libvirt/qemu/nvram/* '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/nvram' chmod -R 777 '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/xml' chmod -R 777 '/mnt/user/'030\ -\ IT\ Support'/'Backup\ Data'/Unraid/'VM\ Settings'/'$datestamp'/nvram' sleep 5 exit Here is SpaceInvaderOne's original script for comparison: #!/bin/bash #backs up #change the location below to your backup location backuplocation="/mnt/user/test/" # do not alter below this line datestamp="_"`date '+%d_%b_%Y'` dir="$backuplocation"/vmsettings/"$datestamp" # dont change anything below here if [ ! -d $dir ] ; then echo "making folder for todays date $datestamp" # make the directory as it doesnt exist mkdir -vp $dir else echo "As $dir exists continuing." fi echo "Saving vm xml files" rsync -a --no-o /etc/libvirt/qemu/*xml $dir/xml/ echo "Saving ovmf nvram" rsync -a --no-o /etc/libvirt/qemu/nvram/* $dir/nvram/ chmod -R 777 $dir sleep 5 exit Was quite a bit of experimenting for a rookie but worth the lessons learned. If anybody see anything out of whack I'd appreciate it but the files are saving to my chosen path in a dated folder. Quote Link to comment
jpotrz Posted February 7, 2019 Share Posted February 7, 2019 maybe it's buried somewhere in this thread but I didn't see it (I admit I didn't read every single post)... but when I choose a predefined option of "Run Weekly" exactly what day/time does it run? I'm going to guess it's weekly based on the time/day I hit the "apply" button? But wanted to make sure. Quote Link to comment
wgstarks Posted February 7, 2019 Share Posted February 7, 2019 3 minutes ago, jpotrz said: maybe it's buried somewhere in this thread but I didn't see it (I admit I didn't read every single post)... but when I choose a predefined option of "Run Weekly" exactly what day/time does it run? I'm going to guess it's weekly based on the time/day I hit the "apply" button? But wanted to make sure. Actually, IIRC, it’s based on settings>scheduler>fixed schedules. It’ll run whenever you have unRAID set to run weekly schedules. Quote Link to comment
Squid Posted February 7, 2019 Author Share Posted February 7, 2019 Actually, IIRC, it’s based on settings>scheduler>fixed schedules. It’ll run whenever you have unRAID set to run weekly schedules.You also need to install the dynamic schedules pluginSent via telekinesis Quote Link to comment
BRiT Posted February 11, 2019 Share Posted February 11, 2019 Fully specify the config location. Quote Link to comment
NewDisplayName Posted February 11, 2019 Share Posted February 11, 2019 why not just python3 /mnt/user/YouTube/youtube-dl ..? Quote Link to comment
Squid Posted February 12, 2019 Author Share Posted February 12, 2019 Probably in retrospect, this all makes perfect sense as user scripts doesn't execute any script through the shell, so any environment variables aren't set. (This is also why you have to give items the full path in some cases vs when executing via a shell you don't have to) Quote Link to comment
PerniciousDuck Posted February 12, 2019 Share Posted February 12, 2019 Hello Team, Hope you are all good. Am new to the unRaid world and have been liking every bit of it lately. @Squid I need your "help" with something. I've added CA User Scripts together with Rclone docker from Wasesh. All is fine and working and I've had a backup running since yesterday to send data to my Onedrive (The backup is not huge but my internet is crap ...). The sync is running in the background and wanted to stop it to let me have "normal' access to internet (since I'm caping my upload) but I don't see the button to stop the task. It's not a problem, I can kill the process via terminal, but I was wondering if you wanted to have a look if something is wrong or it's expected behaviour. Let me know if you want and I'll send you whatever you need. Else, no biggie. Cheers Quote Link to comment
Squid Posted February 12, 2019 Author Share Posted February 12, 2019 (edited) Any long running processes spawned by the actual script do not always wind up getting killed. The plugin does attempt to kill off any child processes of the script, but depending upon what that child does (ie: spawns another child) then it does not always work. Creating another script that has your pkill command in it should however work correctly. EDIT: Looked at the code, and there *might* be a bug in user scripts attempting to kill the childs. Will have to investigate further. How I'm using pkill doesn't jive with the man page on it. Can't remember exactly how I came up with the syntax I'm using. Edited February 12, 2019 by Squid Quote Link to comment
PerniciousDuck Posted February 12, 2019 Share Posted February 12, 2019 DUH ! I did not even thing about something like that. Thanks @Squid Quote Link to comment
NewDisplayName Posted February 12, 2019 Share Posted February 12, 2019 (edited) Also user scripts doenst really see scripts running when they run a long time^^, but theres workarounds for that. To kill rclone u can use that ps -ef | grep "rclone" | grep -v 'grep' | grep -v 'mount' | awk '{ print $2 }' | xargs kill it finds all rclones childs and kill all childs except the ones which work for mount (if u have that running). Edited February 12, 2019 by nuhll Quote Link to comment
Cessquill Posted February 24, 2019 Share Posted February 24, 2019 There may be a valid reason why this is not done already, but if you edit the name of the script, could it also update the name of the corresponding folder in the user.scripts\scripts directory? When I'm working on something I'll often call it something like "z docker testing" to put it at the end of the list. When finished, I rename it, but it still stays at the bottom. I'm guessing the plugin sorts the scripts list by folder name? Quote Link to comment
sibi78 Posted March 5, 2019 Share Posted March 5, 2019 Hi All, I'm using the user scripts plugin to run a custom script every 5 minutes. I've set it up via the GUI, and I provided "*/5 * * * " in the custom field and applied the changes. However, I don't think my script is running every 5 minutes (I'm looking for a log file the script writes to and the log file doesn't get updated with the right timestamps). Am I missing any final steps to run the script periodically? /etc/cron.d/root file does seem to have an entry for my script.... Thanks! Quote Link to comment
trurl Posted March 5, 2019 Share Posted March 5, 2019 You're missing a * should be */5 * * * * instead of */5 * * * http://corntab.com/?c=*/5_*_*_*_* 1 Quote Link to comment
sibi78 Posted March 5, 2019 Share Posted March 5, 2019 @trurl, thanks for the catch. I had tried this manually using crontab -e and it worked fine then, but I think I missed a * when I copied it over to the GUI. So I didn't suspect this. Thanks again, and it seems to work fine now! 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.