txt 파일에 저장된 wget 명령 목록에서 다운로드

txt 파일에 저장된 wget 명령 목록에서 다운로드

다음과 같은 wget 명령 목록이 있습니다.

wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2009_12//00030352160/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2020_11//00031630169/xrt/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_03//00034228170/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2020_03//00031630125/log/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2008_11//00030352101/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2014_04//00035014140/log/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_03//00034228172/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_04//00034228177/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2014_04//00035014133/auxil/
wget -q -nH --no-check-certificate --cut-dirs=5  -r -l0 -c -N -np -R 'index*'  -erobots=off --retr-symlinks https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2019_12//00031630093/auxil/

이는 filename.txt에 저장됩니다. 다운로드하는 방법? 로그 파일에서 다운로드 진행 상황을 어떻게 볼 수 있나요?

답변1

매우 간단한 해결책과 간단한 해결책이 있습니다.

bash filename.txtberndbausch가 말했듯 이 쉘 스크립트는 기본적으로 텍스트 파일과 마찬가지로 명령 목록이 포함된 tex 파일이기 때문에 직접 실행할 수 있습니다 .

또는 더 스마트한 작업을 수행할 수도 있지만 아마도 이 사용 사례에는 그다지 유용하지 않을 것입니다.https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2009_12//00030352160/auxil/,https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2020_11//00031630169/xrt/,...) 텍스트 파일에 기록한 다음 해당 텍스트 파일을 wget에 대한 입력으로 사용할 수 있습니다.

텍스트 파일.txt:

https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2009_12//00030352160/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2020_11//00031630169/xrt/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_03//00034228170/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2020_03//00031630125/log/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2008_11//00030352101/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2014_04//00035014140/log/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_03//00034228172/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2017_04//00034228177/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2014_04//00035014133/auxil/
https://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2019_12//00031630093/auxil

그 다음에: wget -q -nH --no-check-certificate --cut-dirs=5 -r -l0 -c -N -np -R 'index*' -erobots=off --retr-symlinks -i textfile.txt

관련 정보