{"id":438,"date":"2009-08-27T10:34:44","date_gmt":"2009-08-27T15:34:44","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=438"},"modified":"2019-09-04T19:57:40","modified_gmt":"2019-09-05T00:57:40","slug":"how-to-automate-ftp-login-and-file-transfer-with-bash-script","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=438","title":{"rendered":"How to automate ftp login and file transfer with bash script"},"content":{"rendered":"<div style=\"float: left;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 300;\ngoogle_ad_height = 250;\ngoogle_ad_format = \"300x250_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p>Sometime ago I had posted a Korn script to <a href=\"http:\/\/www.gamescheat.ca\/2009\/08\/06\/how-to-automate-ftp-login-and-file-transfer\/\">automate FTP login <\/a>and upload of file on a Unix or Linux computer.  The default shell for most Linux servers is bash.  I ran into a situation on a VMware ESX server where the only shell available is bash.  I had rewrite my script in the bash shell, here it is.<\/p>\n<blockquote><p><strong># !\/bin\/bash<br \/>\n# Andrew Lin<br \/>\n# www.gamescheat.ca<br \/>\nfilename=\u201dfile-to-upload\u201d<br \/>\nhostname=\u201dremote-ftp-server\u201d<br \/>\nusername=\u201dandrew\u201d<br \/>\npassword=\u201dsecret\u201d<br \/>\ncd \/home\/mydir<br \/>\nftp -vn $hostname <<EOF\nquote USER $username\nquote PASS $password\nbinary\nput $filename\nquit\nEOF<\/strong><\/p><\/blockquote>\n<p>Here is the link to the Kron version of the script <a href=\"http:\/\/www.gamescheat.ca\/2009\/08\/06\/how-to-automate-ftp-login-and-file-transfer\/\">http:\/\/www.gamescheat.ca\/2009\/08\/06\/how-to-automate-ftp-login-and-file-transfer\/<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometime ago I had posted a Korn script to automate FTP login and upload of file on a Unix or Linux computer. The default shell for most Linux servers is bash. I ran into a situation on a VMware ESX&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=438\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[55,35],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/438"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438"}],"version-history":[{"count":7,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":991,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions\/991"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}