• ftp via BASH! script

    Recently i developed an e commerce site that sends the order directly to a distributor for shipping after the bank transactions…
    Being a relatively new nerd, i work best destroying someone else’s code (script lion)… so here’s a lil contribution since every example i googled was (significantly) different. Here is a bash script that will upload files if your using a typical Media Temple server using Linux / CentOS 5… Script will also move the files to a new directory… just delete if you don’t want to move anything when your done…

    #!/bin/bash
    set -m
    theDate="$(date +%Y-%m-%d)"

    ftp -vinp ftp.urAddress.com <
    quote USER yourusername
    quote PASS 9assword
    cd Upload
    binary
    put /path/to/your/file/PO850.xml ‘date +%d_%m_%y’_PO850.xml
    quit
    EOF

    cp /path/to/your/file/*.xml /path/to/your/other_directory/

    rm /path/to/your/file/*.xml

    exit 0

    Hope this helps someone… oh… and to the younger script kiddies… don’t be afraid of Linux… shits, tit after a bit!

     worldthreat No comments

    Leave a reply







Shout Outs!

highly recommended brethren...

  • Electric Sheep
  • evilest.net
  • i am cell
  • mlebrun.com
  • rob o’toole – the flexiest man alive
  • ryantgraff.com