Tiny Core Base > TCB Tips & Tricks

Apps downloading is pretty slow

<< < (15/15)

Sashank999:
Oh. I didn't know that.
Is there a way to add timeout option for tce-load or wget ? Or else a retry option for wget ?
Sometimes the connection to repo just breaks in the middle (happens like once or twice a month, so no bother). But when it breaks when I am downloading an extension that has like 100 tree deps (for example) it would take another 15 minutes for the Apps or tce-load to do the whole thing again. Hence I am asking this.

Rich:
Hi Sashank999

--- Quote from: Sashank999 on August 29, 2020, 05:45:16 AM --- ... Is there a way to add timeout option for tce-load or wget ? Or else a retry option for wget ? ...
--- End quote ---
wget has both of those options (-T  and  -c):

--- Code: ---tc@E310:~$ busybox wget --help
BusyBox v1.29.3 (2018-12-19 15:29:37 UTC) multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
        [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy
tc@E310:~$
--- End code ---

If you search the  tce-*  scripts:

--- Code: ---tc@E310:~$ grep wget /usr/bin/tce-*
/usr/bin/tce-audit:             wget -cq -P /tmp "$MIRROR"/"$TARGET" 2>/tmp/fetch_result
/usr/bin/tce-fetch.sh:  wget -cq -O- "$MIRROR"/"${1//-KERNEL.tcz/-${KERNELVER}.tcz}"
/usr/bin/tce-fetch.sh:  wget -cq "$MIRROR"/"$F"
/usr/bin/tce-load:      wget -cq "$MIRROR"/"$1".md5.txt 2>/dev/null
/usr/bin/tce-load:      wget -c "$MIRROR"/"$1"
/usr/bin/tce-load:                                      if (system("rm -f "depfile"; wget -c -P "optional" "mirror"/"name".dep 2>/dev/null") == 0 && ! SUPPRESS)
/usr/bin/tce-status:                    busybox wget --spider -q "$MIRROR"/"$E" 2>/dev/null || echo "$E not found!"
/usr/bin/tce-update:    wget -cq "$MIRROR"/"$1"
/usr/bin/tce-update:            wget -cq "$MIRROR"/"$1" # Either there was no zsync file on the server, or it failed
tc@E310:~$
--- End code ---
you'll see it uses the  -c  option for wget. You can add a  -T  option to the commands above if you think it will help you. Then add
those 4 files to your backup.

The timeout is being used to make sure the command does not hangup forever, not to try to make intermittent network connections
more tolerable. According to the  busybox  config file, the timeout for wget should default to  10 seconds.


--- Quote --- ... Sometimes the connection to repo just breaks in the middle (happens like once or twice a month, so no bother). But when it breaks when I am downloading an extension that has like 100 tree deps (for example) it would take another 15 minutes for the Apps or tce-load to do the whole thing again. ...
--- End quote ---
If  tce-load  gets interrupted, it resumes with the file that failed to download when you run it again.

Sashank999:
I said "to do the whole thing", not downloading. It takes time in verifying tree deps from start if interrupted, not in downloading. I already know that it continues previous downloads (which helped me when I did compiletc).

I think I should study those tce-* scripts. Thanks to the devs for using ash instead of C or C++ for tce- scripts (Idk C or C++).

Rich:
Hi Sashank999

--- Quote from: Sashank999 on August 30, 2020, 05:37:55 AM --- ... Thanks to the devs for using ash instead of C or C++ for tce- scripts (Idk C or C++).
--- End quote ---
You will probably also find some  awk  in those scripts.

Navigation

[0] Message Index

[*] Previous page

Go to full version