Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Preprocessing] NeRSemble 데이터 다운로드 자동화 #14

Open
oMFDOo opened this issue Dec 9, 2024 · 2 comments
Open

[Preprocessing] NeRSemble 데이터 다운로드 자동화 #14

oMFDOo opened this issue Dec 9, 2024 · 2 comments

Comments

@oMFDOo
Copy link
Owner

oMFDOo commented Dec 9, 2024

Image
계속되는 다운로드 오류로 하루종일 쳐다보고 있을 수는 없어 데이터 다운로드 방식을 자동화하였다.

@oMFDOo
Copy link
Owner Author

oMFDOo commented Dec 9, 2024

간단한 bash 파일 작성

: 다운로드 링크만을 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에서 확인하세요."

@oMFDOo
Copy link
Owner Author

oMFDOo commented Dec 9, 2024

로그 확인

: 실패 로그도 콘솔에 출력할 걸 그랬나 싶지만,
Image


그래도 파일에 착실히 저장되고 있는 모습이다.

Image

@oMFDOo oMFDOo moved this from In progress to Hold in 3D 아바타 생성을 위한 탐구 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant