๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ปTech/๐ŸงLinux

[๋ฆฌ๋ˆ…์Šค] FTP ์••์ถ• ํŒŒ์ผ put

by _viper_ 2019. 5. 20.
๋ฐ˜์‘ํ˜•

ftp ์••์ถ• ํŒŒ์ผ ์—…๋กœ๋“œ ํ•  ๋•Œ binary ๋ชจ๋“œ ์‚ฌ์šฉํ•ด์•ผ ํŒŒ์ผ ๊นจ์ง€์ง€ ์•Š๊ณ  ์ •์ƒ ์—…๋กœ๋“œ ๋ฉ๋‹ˆ๋‹ค. (์ž์ฃผ ๊นŒ๋จน๋Š” ๋ถ€๋ถ„..)

๐Ÿ“ค FTP put ์ƒ˜ํ”Œ shell ์ฝ”๋“œ

ftp -n 127.0.0.1 << EOF
quote USER $user
quote PASS $pass
cd $put_path
lcd $local_path
binary
put $file_nm
bye
EOF

binary ๋ชจ๋“œ๋กœ ์—…๋กœ๋“œํ•˜์ง€ ์•Š์œผ๋ฉด ์ผ๋ฐ˜ ํ…์ŠคํŠธ ํ˜•ํƒœ๋กœ ์˜ฌ๋ผ๊ฐ€ ์••์ถ• ํ•ด์ œ ์‹œ ์•„๋ž˜ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋ฐœ์ƒ

gzip : test.csv.gz: invalid compressed data--format violated