BV206 wrote: Mon Aug 26, 2019 1:05 pm
I want to use zsync to download the beta (and the August 18.3 iso).
I see the zsync "files" listed on sourceforge.net but because of their mirrors or something the .zsync url doesn't link to the actual file.
Is there an easy way to do that?
Yea, zsync-ing from sourcefourge is a bit tricky.
The attached zsync-helper script will get first closest mirror before the actually zsync is taking place:
The best result you would have with "binary" close iso.
Ok just testing how it would go, using MX18.3 iso (which is not very "binary" close):
Code: Select all
./zsync-mx-19-testing.sh MX-19beta-1_x64.iso MX-18.3_August_x64.iso
Well at least it tells us that "Target 22.5% complete."
Code: Select all
./zsync-mx-19-testing.sh MX-19beta-1_x64.iso MX-18.3_August_x64.iso
Downloading "MX-19beta-1_x64.iso" file
MX-19beta-1_x64.iso
Using input file: MX-18.3_August_x64.iso
Executing zsync command
#################### 100.0% 601.4 kBps DONE
reading seed file MX-18.3_August_x64.iso: *****************************
**************
++++
***Read MX-18.3_August_x64.iso. Target 22.5% complete.
*******************************************************
downloading from http://iweb.dl.sourceforge.net/project/mx-linux/Testing/MX-19/MX-19beta-1_x64.iso:
######-------------- 32.2% 7147.5 kBps 2:16 ETA
Attached the zsync helper script:
zsync-mx-19-testing.sh
Code: Select all
#!/bin/bash
# zsync helper script
# for MX-19-beta Testing
# filename zsync-mx-19-testing.sh
usage()
{
echo "Usage $0 script"
echo "$0 download_filename.iso inputfile.iso"
echo " Where inputfile.iso is the file you already have that's similar to the one you download"
echo
echo "$0 download_filename.iso"
echo " This command format will search automatically for the most recent MX*x64.iso file in the current folder"
exit
}
[[ "$1" == "--help" || "$1" == "-h" ]] && usage
TARGET="$1"
[[ -z "$1" ]] && {
echo "You need to specify a file name to download. exiting..."
echo
usage
}
echo "Downloading \"$1\" file"
grep "x64" <<< "$1" && ARCH="x64" || ARCH="386"
# add available local ISO-sources here - newest first
# check latest ISO-sources are available
SOURCE="$2"
[[ -f "$SOURCE" ]] && echo "Using input file:" "$SOURCE" || {
[[ "$SOURCE" == "" ]] && echo "Input source not specified, trying to find a useful ISO in current path"
[[ "$SOURCE" != "" ]] && echo "Input file \"$SOURCE\" not found, trying to find a useful ISO in current path"
SOURCE=$(find . -iname "MX*$ARCH*.iso" -printf "%T+\t%p\n" | sort -r | head -1 | cut -f2)
[[ "$SOURCE" != "" ]] && echo "Using "$SOURCE" source file" || {
echo "Could not found an appropriate input file, exiting..."
echo
usage
}
}
# do we have zsync
command -v zsync >&- || {
# opps we need to and install zsync
sudo apt-get update
sudo apt-get install zsync
}
ZSYNC="${TARGET}".zsync
# get closest sourceforge server for zsync
DOWNLD=https://sourceforge.net/projects/mx-linux/files/Testing/MX-19/"${ZSYNC}"/download
SPIDER=$(wget -nv --spider "${DOWNLD}" 2>&1 | grep -Eo https.*iso.zsync | sed 's/https/http/')
[[ -z "$SPIDER" ]] && {
echo; echo "Could not find \"$1\" file on SourceForge server, please check the name. Exiting..."
echo
usage
}
# let's do zsync
[[ -f "${TARGET}" ]] || echo; echo "Executing zsync command"; zsync -i "$SOURCE" "${SPIDER}" || {
echo
usage
}
HTH
