Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music
All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => command , shell script ,tool , crontab => Topic started by: golfreeze on กันยายน 19, 2013, 06:23:38 pm
-
ในกรณีที่ เราต้องการ FTP จากเครื่องหนึ่ง (Server A) ไปอีกเครื่องหนึ่ง (Server B) โดยปกติจะใช้ command "FTP" กันใช่ปะครับ
#ftp server_host
>cd ftp
>mget *
แต่อาจจะติดปัญหาเรื่องของ sub folder ตอน get มาได้ครับ ปัญหานี้ สามารถแก้ไขโดย
ไปที่เครื่องที่จะให้ไฟล์มาอยู่ ครับ (Server B)
#mkdir ftp_folder
#cd ftp_folder
#wget -m ftp://username:password@server_host_name:port_ftp_destination
#wget -m ftp://username:password@103.x.y.z:21
-
###ถ้าในกรณี ftpuser มี @ ด้วยให้ใช้เป็นวิธีด้านล่างนะครับ
wget -m --ftp-user=username@abc.com --ftp-password=foo@bar ftp://ftp.hostname.com/file
###ถ้าในกรณี ftpuser มี @ ด้วยให้ใช้เป็นวิธีด้านล่างนะครับ และเอาไฟล์ทั้งหมด
wget -m --ftp-user=username@abc.com --ftp-password=foo@bar ftp://ftp.hostname.com/*
-
ถ้ารหัสมี special character เช่น ( $
ให้ทำการใส่ single quote ลงไปด้วย เช่น '($%sdfa'
wget -m --ftp-user=username@abc.com --ftp-password='foo@bar(' ftp://ftp.hostname.com/file