psql -U postgres -d video_metadata -c "select (select path from video_file where id =video_file_id) from watch_status where uid=

?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

cd /volume2/XTRM_DSM/_VideoStation/

mkdir `date +%Y%m%d`

 

echo 사용자번호_사용자명 >> /volume2/XTRM_DSM/_VideoStation/`date +%Y%m%d`/사용자명_`date +%Y%m%d`.txt;

psql -U postgres -d video_metadata -c "select (select path from video_file where id =video_file_id) from watch_status where uid = 사용자번호" >> /volume2/XTRM_DSM/_VideoStation/`date +%Y%m%d`/사용자명_`date +%Y%m%d`.txt;

 

 

--------------------------

 

관리자 권한 : sudo -i

 

사용자 목록 : cat /etc/passwd

 

DB접근 : su postgres

 

DB선택 : psql video_metadata

 

명령어 : select (select path from video_file where id =video_file_id) from watch_status where uid = 1234;