lufs의 ftp filesystem 참 유용하군요.
lufs의 ftp filesystem 참 유용하군요.
lufis 'fs=ftpfs,host=XXX,username=XXX,password=XXX' -o allow_other,direct_io,modules=iconv,from_code=euckr,to_code=utf8 /mnt/disk1 -s
lufis 'fs=ftpfs,host=XXX,username=XXX,password=XXX' -o allow_other,direct_io,modules=iconv,from_code=euckr,to_code=utf8 /mnt/disk2 -s
지금 청주에 있는 모 기관에서 작업하고 있는데, 웹서버가 두대씩이나 있습니다.
이넘은 전통적인 ftp 작업 방식대로 할려면 ftp 프로그램을 4개 띄워두어야죠.
2개는 업로드용에 쓰이고, 나머지 2개는 백업과 문제발생시 예전소스 복구용으로.
그렇지 않으면 지겨운 재접속과 directory searching을 반복하는 불편을 감수해야 하는
그게 짜증나서 스크립트 만들어 버렸습니다.
export SRCBASE=XXX # 작업디렉토리
export BKBASE=XXX # 백업/복구용 파일저장디렉토리
export CPBASE1=/mnt/disk1/XXX # 웹서버 1
export CPBASE2=/mnt/disk2/XXX # 웹서버 2
if [ -z $1 ]; then
echo "WARING. NO FILE specified!"
else
cp $CPBASE1/$1 $BKBASE/$1
cp $SRCBASE/$1 $CPBASE1/$1
cp $SRCBASE/$1 $CPBASE2/$1
svn add $BKBASE/$1
fi
이건 업로드용이고 그 외에 백업, 복구용 스크립트와 기타 잡탕구리들도 만들었습니다. (10줄 내외로)
그리고 백업자료들은 모두 subversion 관리체제하에 놓이도록 만들었습니다.
특정 확장자 가진 파일 골라 뽑아내는 것도 꽤 유용하더군요.
for name in `find . -type d`
do
mkdir -p ../newpath/$name
done
for name in `find . -name '*.xxx'` `find . -name '*.yyy'`
do
cp $name ../newpath/$name
done
일이 비교적 수월스럽게 진행되고 있습니다.
하지만 제일 큰 짜증은 기한맞추기 위해 밤 새야 한다는거 OTL.
아, 아직 lufs 이
아, 아직 lufs 이 있었군요.
써본지 꽤 오래되었지만 외부 서버 ftp에 영화 받아놓고 온라인으로 보곤 했었습니다. :-)
--
perl -e's@@JEON Myoung-jin@;sub man{s| _|her e|}
sub see{s;^;Just;;u;s;e ;Perl ;;to;print$_,$/}$uperMan=M;
s=^....=U are not=;s~$uperMan~~;&admitIt;s=U are = A=;s|young|_|;&man;
sub admitIt{say;ye;s!-\w+! Hacker!};see U'
$Myoungjin_JEON=@@=qw^rekcaH lreP rehtonA tsuJ^;$|++;{$i=$like=pop@@;unshift@@,$i;$~=18-length$i;print"\r[","~"x abs,(scalar reverse$i),"~"x($~-abs),"]"and select$good,$day,$mate,1/$~for 0..$~,-$~+1..-1;redo}
curlftpfs OTL
curlftpfs
OTL