Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dietpi-Software | UrBackup Server: Grab latest version string automatically #2783

Closed
athisun opened this issue May 10, 2019 · 7 comments
Closed
Labels
Enhancement 💨 Solution available 🥂 Definite solution has been done
Milestone

Comments

@athisun
Copy link

athisun commented May 10, 2019

There is a new version of UrBackup server available (2.3.8). Download it here

Might it be possible to use the latest endpoint, rather than manually specifying versions? e.g. https://hndl.urbackup.org/Server/latest/urbackup-server_X.X.X_ARCH.deb. There is probably good reason to manually specify versions that I'm unaware of.

Required Information
DietPi version | 6.22.3

@MichaIng MichaIng added this to the v6.23 milestone May 10, 2019
@MichaIng
Copy link
Owner

@DeathIsUnknown
Many thanks for the info.

I tried to find a "latest" download link but couldn't find it until now. This is probably something to address to the UrBackup devs which also allows them to update without having to change their websites download links.

@MichaIng
Copy link
Owner

Hmm there is actually the dir https://hndl.urbackup.org/Server/latest/ but the files inside still contain version strings. But probably we can scrape the version string from there. I have to run some tests about this.

@MichaIng
Copy link
Owner

I hijacked the other PR to add the new UrBackup version: #2779
For v6.24 we will find a way to get the latest version string automatically.

@MichaIng MichaIng modified the milestones: v6.23, v6.24 May 10, 2019
@MichaIng MichaIng changed the title Dietpi-Software | UrBackup Server Update to 2.3.8 Dietpi-Software | UrBackup Server: Grab latest version string automatically May 10, 2019
This was referenced May 10, 2019
@MichaIng MichaIng modified the milestones: v6.24, v6.25 May 15, 2019
@athisun
Copy link
Author

athisun commented Jun 4, 2019

Just tried to get this working on my end. Here's what I've come up with so far: wget -r -l1 -np -nc -nd -A 'urbackup-server_*_armhf.deb' https://hndl.urbackup.org/Server/latest/

Here's the man breakdown if you're interested: https://explainshell.com/explain?cmd=wget+-r+-l1+-np+-nc+-nd+-A+%27urbackup-server_*_armhf.deb%27+https%3A%2F%2Fhndl.urbackup.org%2FServer%2Flatest%2F

This is the output:

--2019-06-05 00:21:05--  https://hndl.urbackup.org/Server/latest/
Resolving hndl.urbackup.org (hndl.urbackup.org)... 198.58.118.162, 2600:3c00::f03c:91ff:fec8:ecf6
Connecting to hndl.urbackup.org (hndl.urbackup.org)|198.58.118.162|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2649 (2.6K) [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp               100%[============================================>]   2.59K  --.-KB/s    in 0s      

2019-06-05 00:21:06 (32.4 MB/s) - ‘index.html.tmp’ saved [2649/2649]

Loading robots.txt; please ignore errors.
--2019-06-05 00:21:06--  https://hndl.urbackup.org/robots.txt
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 404 Not Found
2019-06-05 00:21:06 ERROR 404: Not Found.

Removing index.html.tmp since it should be rejected.

--2019-06-05 00:21:06--  https://hndl.urbackup.org/Server/latest/?C=N;O=D
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 2649 (2.6K) [text/html]
Saving to: ‘index.html?C=N;O=D.tmp’

index.html?C=N;O=D.tmp       100%[============================================>]   2.59K  --.-KB/s    in 0s      

2019-06-05 00:21:06 (16.6 MB/s) - ‘index.html?C=N;O=D.tmp’ saved [2649/2649]

Removing index.html?C=N;O=D.tmp since it should be rejected.

--2019-06-05 00:21:06--  https://hndl.urbackup.org/Server/latest/?C=M;O=A
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 2649 (2.6K) [text/html]
Saving to: ‘index.html?C=M;O=A.tmp’

index.html?C=M;O=A.tmp       100%[============================================>]   2.59K  --.-KB/s    in 0s      

2019-06-05 00:21:07 (17.1 MB/s) - ‘index.html?C=M;O=A.tmp’ saved [2649/2649]

Removing index.html?C=M;O=A.tmp since it should be rejected.

--2019-06-05 00:21:07--  https://hndl.urbackup.org/Server/latest/?C=S;O=A
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 2649 (2.6K) [text/html]
Saving to: ‘index.html?C=S;O=A.tmp’

index.html?C=S;O=A.tmp       100%[============================================>]   2.59K  --.-KB/s    in 0s      

2019-06-05 00:21:07 (24.4 MB/s) - ‘index.html?C=S;O=A.tmp’ saved [2649/2649]

Removing index.html?C=S;O=A.tmp since it should be rejected.

--2019-06-05 00:21:07--  https://hndl.urbackup.org/Server/latest/?C=D;O=A
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 2649 (2.6K) [text/html]
Saving to: ‘index.html?C=D;O=A.tmp’

index.html?C=D;O=A.tmp       100%[============================================>]   2.59K  --.-KB/s    in 0s      

2019-06-05 00:21:07 (46.1 MB/s) - ‘index.html?C=D;O=A.tmp’ saved [2649/2649]

Removing index.html?C=D;O=A.tmp since it should be rejected.

--2019-06-05 00:21:07--  https://hndl.urbackup.org/Server/latest/debian/
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 1573 (1.5K) [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp               100%[============================================>]   1.54K  --.-KB/s    in 0s      

2019-06-05 00:21:07 (15.0 MB/s) - ‘index.html.tmp’ saved [1573/1573]

Removing index.html.tmp since it should be rejected.

--2019-06-05 00:21:07--  https://hndl.urbackup.org/Server/latest/urbackup-server_2.3.8_armhf.deb
Reusing existing connection to hndl.urbackup.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 3388056 (3.2M) [application/x-debian-package]
Saving to: ‘urbackup-server_2.3.8_armhf.deb’

urbackup-server_2.3.8_armhf. 100%[============================================>]   3.23M   550KB/s    in 6.5s    

2019-06-05 00:21:14 (508 KB/s) - ‘urbackup-server_2.3.8_armhf.deb’ saved [3388056/3388056]

FINISHED --2019-06-05 00:21:14--
Total wall clock time: 9.2s
Downloaded: 7 files, 3.2M in 6.5s (510 KB/s)

Which downloads the latest version:

...
-rw-r--r--  1 root root    3388056 Mar 20 23:40 urbackup-server_2.3.8_armhf.deb
...

Subsequent runs of the command prevents fetching the file multiple times:

...  

2019-06-05 00:21:57 (15.9 MB/s) - ‘index.html.tmp’ saved [1573/1573]

Removing index.html.tmp since it should be rejected.

File ‘urbackup-server_2.3.8_armhf.deb’ already there; not retrieving.

FINISHED --2019-06-05 00:21:57--
Total wall clock time: 2.5s
Downloaded: 6 files, 14K in 0s (40.7 MB/s)

@MichaIng
Copy link
Owner

MichaIng commented Jun 4, 2019

@DeathIsUnknown
Quicker and cleaner method:

file=$(curl -sL https://hndl.urbackup.org/Server/latest/ | grep -m1 'urbackup-server_.*_amd64.deb' | cut -d \" -f 8)
wget "https://hndl.urbackup.org/Server/latest/$file"

@athisun
Copy link
Author

athisun commented Jun 4, 2019

@MichaIng Love it!

@MichaIng
Copy link
Owner

MichaIng commented Jun 4, 2019

Done: 220cf13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💨 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

2 participants