Always used to approach the update with trepidation, not knowing if usm would be able to update cleanly. However since doing the scripts, so far so good and always managed to get usm to complete the update.

Testing of the mirrors takes around 4 minutes, but there is nothing to prevent multitasking. There is also the added bonus, as shown above, of being able to push through the usm update come what may (within reason of course). Scripts use sudo to update the mirrors, but if prefer not to, then edit out sudo commands and run as root. Also may wish to take security copy of mirror files: /etc/usm/mirrors-*.txt

At this point no need for any further action, unless there is worry about bandwidth, or one wishes to accomplish the testing and the usm update in series, in which cast the following section on tuning the testing would be of interest.

Script to set the Slackware Mirrors for USM Referred to here as sesm.sh, but can be given any convenient name of one's choosing:<>

sesm invoked with argument all, If 1st argument not all, this will be taken as request to show usage parameters. If problem with sudo, edit out sudo commands, then run as root. Also, to run the script in a shell, the bash shell has to be invoked:<>

Prior to Running Script recommend:

Back Up<>

List current status of all mirrors

Status of All Mirrors script sam.sh:<>

Status Output (might pay to keep a note of current settings):<>

Mirrors can be restored from backup copy. In a root terminal:<>

Fastest Mirror for Single Repository

There is also the option of independently setting the fastest mirror for a repository thru script fasm.sh: <>

Again, has to be invoked via bash shell:<>

Independent Checking

Listings

List All Mirrors of Repository

<>

<>

Check the Repository Mirror

Script crm.sh<>

<>

Timintgs

Directories for Timings Files. Directory holding raw output files will be made in /tmp. Name of directory dictated by function to find fastest mirror of a repository, fasm. If invoked by

sesm files will be created in /tmp/sesm

the shell, as a script, calling function is main, files created in /tmp/main

none, and run directly as a function in terminal, files will be created under /tmp/fasm.

,

Raw Output. These files all named <repository>.lst:<>

Output Refined<>

TIMINGS

Made minutes apart<>

Made minutes apart<>

Made several hours later:<>

So, ability to set mirrors manually obvious. Put together script to manually set the mirror:

masm.sh<>

Invocation<>

Epilog

Last edited by Bogomips on 25 Jul 2017, 23:00, edited 10 times in total.

sesm invoked with argument all, If 1st argument not all, this will be taken as request to show usage parameters. If problem with sudo, edit out sudo commands, then run as root. Also, to run the script in a shell, the bash shell has to be invoked:

Inspection of the timimgs shows a wide discrepancy between those made minutes apart and those made several hours later. For instance, slackware.mirrorcatalogs.com which featured ate the top of the list is nowhere in the top ten, several hours later.. Clearly indicates a dependency on time of day, and also perhaps on prevailing conditions in the Internet.

So, ability to set mirrors manually obvious. Put together script to manually set the mirror:

This should take most of the guesswork out in regard to which mirror to try, whether it be performance improvement or the need to try a different mirror. As well would be good idea to set the mirrors before embarking on a lot of usm-ing.

Script has been supplemented here with couple of helper routines, which I found needed to knock up for my requirements. If problem with sudo, run as root all scripts that set mirrors.

Script to Set Alternate Fast Mirror for a Repository, safm.sh, needs to be run in a bash shell, and after one of scripts sesm.sh or fasm.sh (Setting Slackware Mirrors or Fastest Mirror for Repo) has run, This is because safm.sh operates on the raw output generated by these scripts.

This is logical, as safm.sh has been concieved to resolve issues thrown up by usm with the fastest mirror that has been set. Illustration showing action Interleaved between Two Terminals:

At the moment badm.sh does not look for raw output of fasm, but instead needs sesm run raw output. Will be fixed for fasm in due course.

Enjoy!

Superseded

Script to Set Slackware Mirrors for USM, now enhanced to allow Command Line List of Mirror Exclusion URLs. Ideally for mirrors with USM issues, and these mirrors are ones with tendency to be selected as the fastest mirrors.

Script to Set Fastest USM Mirror for a Repository, now enhanced to allow Command Line List of Mirror Exclusion URLs. Ideally for mirrors with USM issues, and these mirrors are ones with tendency to be selected as the fastest mirrors. The script fasm.sh can be Cut Out from sesm.sh

I'm not sure, actually pretty sure, I understand what you're trying to do with this new script. The fasm.sh script you posted earlier, and my little fasmez.sh script, work great and create fast mirrors for USM so what more is needed?

TTBOMK the bash shebang requests the bash interpreter to take over. The sh interpreter has its limitations. Presume if script were made executable and invoked the same as fastest-mirror, this issue would not arise.

Ed_P wrote:work great and create fast mirrors for USM so what more is needed?

To be user friendly?

Update Edit

Actually pays to put in the extra effort: clean up comments and put in error messages. For sure as God made little apples one gets suddenly deeply involved somewhere else, and when one comes back to use what one has written, one has become the user! But with help of appropriate error messages and comments one has no need to plough once more through the code to find out why it's no longer working. 8)

Last edited by Bogomips on 16 Jun 2017, 00:43, edited 1 time in total.
Reason:Update Edit

Bogomips wrote:Actually pays to put in the extra effort: clean up comments and put in error messages. For sure as God made little apples one gets suddenly deeply involved somewhere else, and when one comes back to use what one has written, one has become the user! But with help of appropriate error messages and comments one has no need to plough once more through the code to find out why it's no longer working. 8)

So we have: sesm.sh, usmbkup.sh, usmrstr.sh, sam.sh and masm.sh. I don't know where to create a /home/guest/USM folder for these plus a couple of other USM related scripts or a folder named /home/guest/Bogomips!!

^ Re Edit. There's no need for all that .As I've said before, post also serves as a reference for myself. Don't have to rummage through my files. Just open the post, and it's all there nicely formatted. 8)