# Synology - [[불량 섹터]] - [[synology NodeJS]] ## DownloadStation 완료목록 삭제 스크립트 #!/bin/sh # Download_queue 테이블 status 컬럼 Key 값 # 1. 대기 중 # 2. 다운로드 중 # 3. 일시 정지 # 4. 종료 중 # 5. 다운로드 완료 # 6. 해시 체크 # 7. 시딩 중 # 8. 파일 호스팅 대기 # 9. 압축 해제 중 # 113. 토렌트 파일 중복 오류 # psql download # delete completed list # 5 - 완료 psql -t -A -U postgres -d download -c "DELETE from download_queue where status in (5, 7, 8, 113)" # 1시간이 지나도 0인 것들 삭제 psql -t -A -U postgres -d donwload -c "DELETE from download_queue where current_size=0 and started_time != 0 and started_time < EXTRACT(EPOCH FROM now() - interval '1 hour')" # "SELECT current_size, started_time from download_queue where current_size=0 and started_time != 0 and started_time < EXTRACT(EPOCH FROM now() - interval '3 day')" # 오래된 파일 삭제 find /volume2/video/ -mtime +99 -exec rm {} \; # 특정 파일 삭제 find /volume1/Download -type d -name 9.* -exec rm -r {} \; # 빈 폴더 삭제 find /volume1/video/ -type d -empty -delete