trurl 1555 Posted September 17, 2020 Share Posted September 17, 2020 1 hour ago, Alex.b said: /mnt/user/disk2/Nextcloud_backup Are you sure this is the actual path? That is a user share named disk2. I recommend not having a user share named the same as a disk. It will only lead to confusion. If this is indeed the correct path, maybe it was not what you had in mind. What did you have in mind? Quote Link to post
Alex.b 12 Posted September 17, 2020 Share Posted September 17, 2020 (edited) Yes sorry, it's /mnt/disk2/Nextcloud_backup (I manually deleted all old folders) Edited September 17, 2020 by Alex.b Quote Link to post
mgutt 378 Posted September 17, 2020 Share Posted September 17, 2020 (edited) 21 hours ago, Alex.b said: How can I keep for example last 10 folders ? Look here: https://stackoverflow.com/q/13868821/318765 Another solution with counting instead of timestamp: https://stackoverflow.com/q/4126869/318765 Edited September 18, 2020 by mgutt Quote Link to post
sauso 10 Posted September 20, 2020 Share Posted September 20, 2020 Found a weird little bug that made for some interesting troubleshooting. I created a script with an exclamation point at the start. User scripts did not like this. Started throwing errors in the console. wouldn't allow me to delete so I removed from console. Lesson learnt, don't start scripts with a ! Quote Link to post
je82 19 Posted September 21, 2020 Share Posted September 21, 2020 I have a problem where whenever an rsync script is ran via user scripts, Quote rsync -avu --chown=nobody:users --chmod=Du=rwx,Dgo=rwx,Fu=rw,Fog=rw --delete --stats --exclude=/cache/ -e "ssh -i /root/.ssh/NAS-rsync-key -T -o Compression=no -x" "myusername@1.1.1.10:/var/www/html" "/mnt/user/Backup/test" >> /home/nasbackuplogs/logs/$(date +"%Y%m%d")-test-backup.log When i test running this in the CLI it works fine, it sets both directories and files that are being backed up to the correct permissions for unraid, but whenever the same command runs via user scripts it for whatever reason sets the directory permissions to drwxrwx--- instead of drwxrwxrwx+, please advise? Quote Link to post
JoeUnraidUser 25 Posted September 21, 2020 Share Posted September 21, 2020 1 hour ago, je82 said: I have a problem where whenever an rsync script is ran via user scripts, When i test running this in the CLI it works fine, it sets both directories and files that are being backed up to the correct permissions for unraid, but whenever the same command runs via user scripts it for whatever reason sets the directory permissions to drwxrwx--- instead of drwxrwxrwx+, please advise? Try adding the following to the beginning of your command so it runs in a login shell: sudo -i -u root Quote Link to post
je82 19 Posted September 21, 2020 Share Posted September 21, 2020 50 minutes ago, BRiT said: Might need to set the UMASK in your script. can you elaborate on how to do this properly? Quote Link to post
JoeUnraidUser 25 Posted September 21, 2020 Share Posted September 21, 2020 (edited) 1 hour ago, je82 said: can you elaborate on how to do this properly? To set the umask to 0000 do the following on a line before your command: umask 0 Edited September 21, 2020 by JoeUnraidUser Quote Link to post
Alex.b 12 Posted September 21, 2020 Share Posted September 21, 2020 How can I access to /tmp/user.scripts/ to view full logs ? Quote Link to post
Matt_UK 0 Posted September 22, 2020 Share Posted September 22, 2020 Hi Love this plugin, have one issue, where only the first entry get the three icons (Log file, Download Log, and Delete Log) Ive inspected the dom, and the icons are there for the other lines, but display:none is applied Does any one know why, or is this a bug? Thanks Added to CA:March 30, 2018 Date Updated:August 21, 2020 Current Version:2020.08.22 Quote Link to post
jonathanm 1208 Posted September 22, 2020 Share Posted September 22, 2020 4 minutes ago, Matt_UK said: Hi Love this plugin, have one issue, where only the first entry get the three icons (Log file, Download Log, and Delete Log) Ive inspected the dom, and the icons are there for the other lines, but display:none is applied Does any one know why, or is this a bug? Thanks Added to CA:March 30, 2018 Date Updated:August 21, 2020 Current Version:2020.08.22 Until the script actually HAS a log file, the buttons are hidden. Or are you saying the scripts seem to be running on schedule, but still no buttons? Quote Link to post
Squid 2958 Posted September 22, 2020 Author Share Posted September 22, 2020 As long as the script has actually run, the log will always be present, if only saying that the script ran at such and such time. Quote Link to post
Cpt. Chaz 20 Posted September 23, 2020 Share Posted September 23, 2020 On 9/21/2020 at 5:29 PM, Alex.b said: How can I access to /tmp/user.scripts/ to view full logs ? open unraid terminal (or ssh, etc) and use the "cd" command like so: cd /tmp/user/scripts/tmpScripts/xxx/ be sure to use capitals when necessary. If the script log is short, you can use the "cat" command to view directly in terminal window like so: cat /tmp/user.scripts/tmpScripts/xxx/xxx.txt (or if you used the "cd" command to navigate to the directory already, use:) cat xxx.txt If the log is too long to view its contents entirely in the terminal, you can copy the log to an easier to access location, such as a folder on the array, and open with a notepad app to view the whole log, like so: cp /tmp/user.scripts/tmpScripts/xxx/xxx.txt /insert/destination/path/here hope this helps Quote Link to post
Derek_ 12 Posted September 26, 2020 Share Posted September 26, 2020 On 9/17/2020 at 4:55 AM, cmarshall85 said: @Derek_ did you ever figure this out? I am having the same issue. When I run lftp, any folders/files it creates are root:root and i need it to be nobody:users. Thanks! Hiya, sorry it's taken so long to reply. No - i never figured it out. I just accepted it as it was. As someone mentions, you can chown it after operations are complete if that works for your scenario. Quote Link to post
54tgedrg45 0 Posted October 3, 2020 Share Posted October 3, 2020 (edited) Eum, where are the script output logs stored? after execution(of all scripts) I get the trashcan to delete log icon/prompt to delete log of task name, not informing path of log. How to view them? No idea where it would be. at flash /logs it shows none. Edit: OK, they can be found at /tmp/user.scripts/tmpScripts/ # logfile log.txt Edited October 3, 2020 by 54tgedrg45 Quote Link to post
mgutt 378 Posted October 3, 2020 Share Posted October 3, 2020 2 hours ago, 54tgedrg45 said: Eum, where are the script output logs stored? There aren't any. The logs are buggy so I used this at the beginning of all my scripts: # logging exec > >(tee --append --ignore-interrupts $(dirname ${0})/log.txt) 2>&1 By that all output is twice in the logs, but this was the only solution that worked. And only to inform you. There is another bug. Its not possible to stop scripts although the dashboard claims it. It seems @Squiddid not found the time to correct it. I posted two ways to solve it. Quote Link to post
jowi 10 Posted October 3, 2020 Share Posted October 3, 2020 (edited) User scripts has grown from a quickly bolted together handy but buggy tool into a substantial part of unraid that a lot of users have use for, and it needs and deserves a lot of rework and refactoring and attention to take it to a higher level. Edited October 3, 2020 by jowi Quote Link to post
jonathanm 1208 Posted October 3, 2020 Share Posted October 3, 2020 3 minutes ago, jowi said: it needs and deserves a lot of rework and refactoring and attention are you volunteering your time and expertise? Quote Link to post
jowi 10 Posted October 3, 2020 Share Posted October 3, 2020 (edited) Yes, if i had the expertise. I can do c# .net core etc programming and some minor python, but somehow i think that is not needed here. Also linux is not my thing. If you’re suggesting i am not allowed to comment unless i contribute? F*** you. That is not up to you. Edited October 3, 2020 by jowi Quote Link to post
Squid 2958 Posted October 3, 2020 Author Share Posted October 3, 2020 5 hours ago, mgutt said: The logs are buggy The logs are everything that is output by the script. And there's a download button that grabs them. Other things This is going to come across as a bit bitchy, but I truly don't mean anything by it. This plugin was simply designed to run a quick and dirty script here and there. It has definitely morphed into something else. And yes there are issues with Certain script naming will crash the plugin Sub processes spawned off of the initial script have issues being stopped Priorities are everything. While I do understand and appreciate the comments and suggestions, time doesn't always play along with supporting of code changes (or as probably needed here a complete rewrite of the plugin - which isn't an inconsequential time investment) and/or fixes. My priorities are as follows: CA, application feed, related items. They trump everything else Actual real-world work Fix Common Problems (Any false positives that may pop up as new versions of Unraid are released) Unraid GUI bug fixes etc Alexander Keith's Dogs Sleep Family Doom (Hopefully the wife doesn't read this , but that order does keep me sane) So far as time permitting after all of that, the priorities that I see plugin related (time permitting) are Autoupdate. I've noticed some oddities that I'm not sure if its a bug or not and need to investigate Backup / Restore - restart order doesn't match what's been utilized in the docker tab Cleanup Appdata - needs a big revamp to make it functionally work without probable timeouts happening if/when the deletions take more than 120 seconds Backup / Restore - Longstanding req to separate the archives by folder, and selectively restore them This plugin lags behind because it still is 100% functional within its original design considerations. Problem with it is that the code is ancient, and a rewrite is basically required to bring it into line with everything else, and make it maintainable. Unfortunately due to priority #2, my time is extremely limited until Christmas, and what time I do have may be filled up with priority #5 when the situation may change. I will get to it. I, like everyone else around here am a volunteer. In the meantime if anyone has any PRs, then they will get merged after testing. Quote Link to post
mgutt 378 Posted October 3, 2020 Share Posted October 3, 2020 3 hours ago, Squid said: The logs are everything that is output by the script. And there's a download button that grabs them. No. Does not work. echo "bla" is not logged. No verbose output is logged. Only fatal errors are logged. This is the reason why so many people complain and ask for the "real download" Quote Link to post
54tgedrg45 0 Posted October 3, 2020 Share Posted October 3, 2020 I was searching for the path of the logs since there is no download button that grabs them. I'm now thinking of putting all output together with the rsync log file at backup destination. Quote Link to post
mgutt 378 Posted October 5, 2020 Share Posted October 5, 2020 On 10/4/2020 at 12:00 AM, mgutt said: No. Does not work. echo "bla" is not logged. I have to correct myself. It seems a recent version has solved this issue, as my logs are now working without my solution. Quote Link to post
je82 19 Posted October 7, 2020 Share Posted October 7, 2020 (edited) scripts ran by user scripts plugin are they run as root user? edit: is there a way to run the script as a specific user? Edited October 7, 2020 by je82 Quote Link to post
1233 posts in this topic Last Reply
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.