Wget script for overnight downloads.
I just finished hacking this together. I tested as I built. It seems to be working. I've got it running on 2 directories with 2 different input files. Will see tomorrow if it succeeded all files. Sharing both to get suggestions on how to improve, as well as if anyone may find it useful. I'm sure there is a way to simplify this.
Code:
until [[ $(date +%H) == 04 ]] ; do Input file layout Code:
www.download.link "name of file.whatever" |
would be nice to show an input file (how is it related to a html5 page).
use shellcheck to check your script (will show you interesting comments) your Code:
echo $line | grep char also you can use read -r host url which will give you host and url immediately, there will be no need to use awk/cut... But there is room for other improvements too... |
It's not related to html5 at all on the input. It's manually created. I need to figure out how to scrape it. I'll redo to fit your suggestion on the $line.
|
VAR1 and VAR2 is not very descriptive.
Neither is $1 and $2. There's no comments in the code and I don't understand what most of it does. Starting with the first line: 'until [[ $(date +%H) == 04 ]]' ???? |
Code:
#!/bin/bash |
It looks like you did not check it with shellcheck. I told you additional improvements, you probably missed them. Don't really important.
You can also put wget commands into background and in that case they will run parallel, need not wait to each other. |
I got the [[ "$line" =~ ]] one added. Not sure how to use on the others. more research.
|
Code:
www.download.link,name of file.whatever Code:
#!/bin/bash |
Ive seen IFS but never used it. Working with it now. Thank you.
|
Code:
#!/bin/bash Inputfile example Code:
https://download-a.akamaihd.net/files/media_publication/a8/ebtv_E_01_r720P.mp4`Was the Universe Created? Code:
https://download-a.akamaihd.net/files/media_publication/a8/ebtv_E_01_r720P.mp4`Was the Universe Created?# Code:
-rw-rw-r-- 1 jason jason 38401322 Apr 13 08:30 'Was The Universe Created.mp4' |
Code:
#!/bin/bash |
I agree with pan64, you can not edit a file that is already open and and to elaborate on the temp file suggestion.
Code:
tmp=$(mktemp) |
OK. changes made. will run it tonight and see what comes out. Thank you all again.
|
Ok did some more testing today and had to redo my sed syntax to get it all right. managed to greatly simplify in the process. incorporated syntax suggestions above in almost every place mentioned.
Code:
#!/bin/bash |
ok, so do you need any help now?
|
All times are GMT -5. The time now is 06:12 AM. |