Results 1 to 5 of 5

Thread: Create bash script for ftp

  1. #1
    Join Date
    Jul 2009
    Posts
    1,179

    Create bash script for ftp

    Hello friends,

    I am facing some issue in Linux where i am trying to write a script that will connect to an FTP server and get a file for the same. I don't think so it would be a difficult task for other, i asked my friends about it but they also don't have any idea about it , does anyone know how to do this task or if anyone can direct me how to do it.

  2. #2
    Join Date
    Mar 2009
    Posts
    89

    How to create bash script for ftp

    Sure i will provide you code for creating bash script for ftp but before that i need to some ftp details like your IP address, username, domain name, password and at the same time i would also suggest you to change the password once while running your batch file, so that no one hack your system or your website.

  3. #3
    Join Date
    Jul 2009
    Posts
    1,179

    Create bash script for ftp

    Following are my details of my ftp

    IP address xx.xxx.xx.xx
    username=abc
    domain = app.sample.ftp
    password= password123

    Do you need anything else and thank you for reminding me about changin the password.

  4. #4
    Join Date
    Mar 2009
    Posts
    89

    Create bash script for ftp

    In that case you need to use the following code for creating bash script for ftp and i am sure this will definetly work for you

    Code:
    #/bin/ksh
    # $1 is the file name
    # usage: this_script  <filename>
    IP_address="xx.xxx.xx.xx"
    username="abc"
    domain = app.sample.ftp
    password= password123
    
    echo "
     verbose
     open $IP_address
     USER $username $password
     put $1
     bye
    " > ftp -n > ftp_$$.log

  5. #5
    Join Date
    Jan 2009
    Posts
    133

    Re: Create bash script for ftp

    Thank you for replying me i had saved the script under normal user and at the same time i had set up to get a file from FTP server instead of putting to the server. At the same time if i try to run perl script.pl i am sure this will won't helped me a lot, so in that case i had given more permissions where user is able to grab the file but before that i need to lock it down a bit more for security.

Similar Threads

  1. Bash script needs to e-mail output
    By Kim|ball in forum Technology & Internet
    Replies: 4
    Last Post: 27-05-2011, 10:19 AM
  2. How to create CGI script in bash?
    By Mulan in forum Software Development
    Replies: 5
    Last Post: 01-09-2010, 08:19 PM
  3. Linux bash script with the command w
    By Trini Alvarado in forum Operating Systems
    Replies: 4
    Last Post: 22-03-2010, 12:11 PM
  4. Bash script if then else help
    By Unix'EM in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 06:34 PM
  5. Create a bash script for sftp
    By Xubuntu_user in forum Operating Systems
    Replies: 3
    Last Post: 06-08-2009, 09:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,700,890.95803 seconds with 17 queries