cobra/josm-update-script

numbackup and rev 10000

Opened this issue · 1 comments

As JOSM today reached revision number 10000 the script first downloads, then deletes the latest version (that is, when the number of desired backup files is reached). And then complains that the latest version isn't available:

jos
Lokale Revision ist 9997, neueste verfügbare Revision ist 10000 - starte Download von josm-latest...
lade josm-latest, revision 10000 herunter...
--2016-03-16 18:02:58--  http://josm.openstreetmap.de/download/josm-latest.jar
Resolving josm.openstreetmap.de (josm.openstreetmap.de)... 2a01:4f8:c17:2906::2, 78.47.65.34
Connecting to josm.openstreetmap.de (josm.openstreetmap.de)|2a01:4f8:c17:2906::2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10766381 (10M) [application/java-archive]
Saving to: 'josm-10000.jar'

josm-10000.jar                          100%[============================================================================>]  10.27M  5.27MB/s    in 1.9s    

2016-03-16 18:03:00 (5.27 MB/s) - 'josm-10000.jar' saved [10766381/10766381]

Lösche josm Revision 10000
starte josm...
josm wurde mit mit Prozess-ID 14998 gestartet
Error: Unable to access jarfile /home/nadar/bin/josm-archive/josm-10000.jar
josm wurde beendet

yes, I confirm. The quickest dirty hack is to delete all cached versions and postpone the solution to version 100.000 ;-)

The problem is in "cleanup" here, because ls doesn't do natural sort:
oldestrev= `ls josm*.jar | cut -d '-' -f 2 | cut -d '.' -f 1 | head -n $i | tail -n 1``