Resource icon

multi_report.sh version for Core and Scale 3.0

vexter0944

Dabbler
Joined
Jan 4, 2023
Messages
34
**UPDATE** - when I run with sudo it worked...and cron task is working as well. Sorry for the premature red-alert! And a THANKS to the author - love having this email in my inbox daily!

Got errors when I upgraded - any input?
1681570617732.png
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Still just works. Thanks, again!
Appreciate that. Not much has changed on the face of the script.

This version can update itself. Read the manual!
This is not and automatic update, it requires user action, but you will get notification when an update is posted. I feel that the end user should be in control of the script, not the script in charge of the end user. I will make an update to the script that will allow for fully automatic updates if I hear that someone really wants that feature.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Got errors when I upgraded - any input? Was running as sudo as you can see in the screenshot.
So I'm not a full time Scale person but I think the issue is you are not running as 'root'. It's defiantly a permissions issue.

I'm headed out of town for a few hours. If someone else has not assisted you, I'll try to replicate the issue and help you out.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
**UPDATE** - when I run with sudo it worked...and cron task is working as well. Sorry for the premature red-alert! And a THANKS to the author - love having this email in my inbox daily!
I didn't see the update and I found the same thing, must use 'sudo' to make it work this way. I do appreciate you bringing this to my attention, it will make it into the User Guide for the next person who has an issue.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Updated User Guide

FYI: When you upgrade the script using the '-update' switch, the current User Guide will always be placed in the script location.
 

Attachments

  • Multi_Report_User_Guide.pdf
    1.1 MB · Views: 227
Last edited:

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Just a suggestion:

Code:
<  cp /tmp/multi_report_update.txt $runfilename
> cp /tmp/multi_report_update.txt $runfilename ; chmod 700 $runfilename
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Just a suggestion:

Code:
<  cp /tmp/multi_report_update.txt $runfilename
> cp /tmp/multi_report_update.txt $runfilename ; chmod 700 $runfilename
Completely Understood.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
@awasb
In my testing I've included this but changed to 755. I need 755 for the development portion but could change back to 700 on the final distribution, well after testing with 700 to ensure it's not too restrictive. Any thoughts?
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Appreciate that. Not much has changed on the face of the script.


This is not and automatic update, it requires user action, but you will get notification when an update is posted. I feel that the end user should be in control of the script, not the script in charge of the end user. I will make an update to the script that will allow for fully automatic updates if I hear that someone really wants that feature.
Not fully automatic. Just remove the press a y or abort. The user has already chosen to run an update by including -update. The press y to continue I consider superflous
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Not fully automatic. Just remove the press a y or abort. The user has already chosen to run an update by including -update. The press y to continue I consider superflous
The people have spoken. The changes are almost done and it will update during a normal run if a change is available, then run the new script.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
The people have spoken. The changes are almost done and it will update during a normal run if a change is available, then run the new script.
No interaction required?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
No interaction required?
None at all, if you choose that option. I would have included that in version 2.4 but I still feel that it should be a manual operation. My arm has been twisted and it will be a fully automatic operation. I'm working on notifications so the user knows it's been updated, and cksum data as well.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
I don't know if it's possible, if you can set this in the config for automatic update yes/no then everybody can choos. Don't stone me if it's not possible was just a thought train of mine
It's actually much more involved than that, if that user still wanted the script to run after the update.

The fully automatic option will be disabled by default and the script will operate the same as the current release. The user can run the -config switch and a new fully automatic option will be available. Once this is selected the script will run, check if there is an update available, if there is then download it, upgrade the script, and lastly it will run the new script. Simple, right? Easy to say, more difficult to make it work properly. But I had it working last night on Core, it just needs some grooming and I want to implement a cksum to ensure the file download is valid. I should have done that in the beginning after thinking about it. Better late than never.

I should have the update completed tonight if all goes well. That means testing on Core and Scale.

If there is anything else that someone would like included, keeping in mind that this is a Drive/Storage script, not a free for all things script. It's complex enough already. But still, if there is a request, I'll humor it.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Anyway thank you for your efforts Joe.
Appreciate that but I do gain something from all of this... Knowledge, and it fills some otherwise boring hours.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
I should have the update completed tonight if all goes well. That means testing on Core and Scale.
Change this to this weekend. I got the CRC and the Automatic Updates working in Core last night. I still need to test in Scale. Then after my final change, retest. If I'm updating some ones software automatically, I want to be damn sure I don't break the script and it ends up in a forever loop :wink:
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,995
Backed by popular demand, Automatic Updates Are Incorporated!

If you are running the current script (version 2.2 or better) you will have a notification to run the update procedure to get the new script using
'-update', no need to download and install the attached script.

What does this version include? A bugfix, a few recommendations, and some optimizations, and while that does not sound like a lot, it took time to test it on both Core (FreeBSD) and Scale (Debian) to make sure it works and I didn't break anything in the process, although if I did break something, I'm sure someone will let me know right away. Here is the changelog...

# V2.4.1 (29 April 2023)
# - Bugfix to allow script to be run outside the script directory.
# - Updated chmod 755 to the new script file.
# - Updated cleanup routine for upgrade files left behind.
# - Updated TrueNAS Config Backup name to reference the NAS name.
# - Added Automatic Update Feature.
# - Added Update Script File Checksum Check.

The User Guide has also been updated. I recommend that you at least skim through it's 26 pages. The Common Problems and Solutions is a good section and I'm more than happy to expand this if provided a PM/email.

Automatic Updates is turned off by default. You will need to run '-config' and go to the Advanced Configuration, select Update Script, and make the change. Do not forget to Write your change to save your changes. Note that if you do this, whenever I push a new update, it will update your system the next time you run your script, without any warning. This would be a security issue for most companies and some users so I do not expect everyone to use it, but it's there for those who want it.

As always, if you find an error/issue or improvement, please let me know.
 

Attachments

  • multi_report_v2.4.1_2023_04_29.txt
    337.9 KB · Views: 150

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Great work, Joe! Runs fine here on CORE. (If one uses the right script to update. :rolleyes:) Especially the reworked config dialogue (and within the "automatic drive compensation" function) is a "technical" icing on the cake!
 
Last edited:

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Do not forget to Write your change to save your changes. Note that if you do this, whenever I push a new update, it will update your system the next time you run your script, without any warning. This would be a security issue for most companies and some users so I do not expect everyone to use it, but it's there for those who want it.
You mean the script, right? Not the system's TN version.
 
Top