You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
: 다운로드 링크만을 links.txt에 몰아넣고 성공/실패 로그를 남기도록 하였다.
네트워크가 불안정한지 실패/성공을 반복하기 때문이다.
#!/bin/bash
link_file="links.txt"
# 실패한 다운로드 기록 파일
log_file="failed_downloads.log"
# 기존 로그 파일이 있으면 지우기
> "$log_file"
# links.txt 파일에서 각 링크를 읽어서 다운로드
while IFS= read -r link; do
# 파일명은 링크에서 추출
filename=$(basename "$link")
# 다운로드 시도
echo "다운로드 중: $filename"
if ! wget -q "$link" -O "$filename"; then
# 다운로드 실패 시 로그 기록
echo "실패한 파일: $filename" >> "$log_file"
echo "로그: $(date) - 다운로드 실패: $filename" >> "$log_file"
else
echo "다운로드 성공: $filename"
fi
done < "$link_file"
echo "다운로드 완료. 실패한 파일은 $log_file에서 확인하세요."
계속되는 다운로드 오류로 하루종일 쳐다보고 있을 수는 없어 데이터 다운로드 방식을 자동화하였다.
The text was updated successfully, but these errors were encountered: