Loading ...
Sorry, an error occurred while loading the content.

Re: [LinkStation_General] Need help with FTP shell script from linux -> LS Network Storage Center

Expand Messages
  • pfink
    ... What s the OS on the system you re FTPing from?
    Message 1 of 8 , Jun 3, 2006
    • 0 Attachment
      mixed_mind_assistance wrote:
      > Hello again,
      >
      > I can do this all by the command line getting to the buffalo link
      > station and do understand the commands I can use with command line
      > ftp, but cannot seem to get the command line ftp to work.
      >
      > I can probably just back up my data locally to the server then store
      > it on the LS NSC.
      >
      > ftp
      > open x.x.x.x
      > username
      > password
      > bin
      > hash
      > cd /path/to/target/directory
      > lcd /path/to/source/directory_of_files/getting_backed_up
      > mput myfiles
      > quit
      > exit

      What's the OS on the system you're FTPing from?
    • mixed_mind_assistance
      ... I m trying to FTP from Fedora Core 4. I have been to a website talking about KUROBoxes and modifications. I don t think I should modify the box since it
      Message 2 of 8 , Jun 3, 2006
      • 0 Attachment
        --- In LinkStation_General@yahoogroups.com, pfink <pfink@...> wrote:
        >
        > mixed_mind_assistance wrote:
        > > Hello again,
        > >
        > > I can do this all by the command line getting to the buffalo link
        > > station and do understand the commands I can use with command line
        > > ftp, but cannot seem to get the command line ftp to work.
        > >
        > > I can probably just back up my data locally to the server then store
        > > it on the LS NSC.
        > >
        > > ftp
        > > open x.x.x.x
        > > username
        > > password
        > > bin
        > > hash
        > > cd /path/to/target/directory
        > > lcd /path/to/source/directory_of_files/getting_backed_up
        > > mput myfiles
        > > quit
        > > exit
        >
        > What's the OS on the system you're FTPing from?
        >


        I'm trying to FTP from Fedora Core 4.

        I have been to a website talking about KUROBoxes and modifications. I
        don't think I should modify the box since it would void the warranty.
        I would like to be able to mount this if possible, but I don't think
        it is going to be possible without all of these linux modifications.

        I've been having issues with my near-line storage USB HDD and Webmin
        backups failing, believing that to be putting a large strain on my
        system and thats why its failing b/c the tar balls are about 20-30gb a
        piece.

        While I think the HD-H250LAN might be able to be modified, I also know
        nothing about the processor on it, etc. It seems as if all the hype
        and talk in converting these is the LS I and LS II so it looks as if I
        might be in the dark in my scenario of owning the HD-H250LAN.

        It would be nice to be able to do a FTP Backup across the LAN to this
        box but I'm not sure how to do that in real-time since I don't have
        any scripts to do that other than webmin.

        I could tarball them locally then FTP them across the lan to the
        HD-H250LAN if I could figure out how to script just simply moving
        several tarballs across the lan, however these tarballs are quite
        large and might take quite some time meaning I would have to schedule
        them 1 day out of the week during an off-peak time.

        Hopefully you catch my drift here, I'm not trying to make this a
        server really, but if thats my only hope I'd like to know then if I
        could simply download the firmware and reflash it by downloading 2.05
        from buffalo's website if I wanted to start from scratch again.

        I know, too many questions in one post, but its all relative ;-)p

        With the FTP thing what I'm trying to accomplish it shouldn't be a
        difficult task, just one I haven't tried, and I have read up on FTP sc
        ripts and tried but it fails consistently.

        Hope that helps..
      • pfink
        ... Try this shell script: #!/bin/sh HOST= ftp.example.com USER= username PASSWD= password ftp -u $HOST
        Message 3 of 8 , Jun 3, 2006
        • 0 Attachment
          mixed_mind_assistance wrote:
          >
          > I'm trying to FTP from Fedora Core 4.

          Try this shell script:

          #!/bin/sh
          HOST='ftp.example.com'
          USER='username'
          PASSWD='password'

          ftp -u $HOST <<END_SCRIPT
          quote USER $USER
          quote PASS $PASSWD
          bin
          hash
          cd /path/to/target/directory
          lcd /path/to/source/directory_of_files/getting_backed_up
          mput myfiles
          quit
          END_SCRIPT
          exit 0
        • mixed_mind_assistance
          ... I ll try that one again, but I *do* believe it fails ..
          Message 4 of 8 , Jun 3, 2006
          • 0 Attachment
            --- In LinkStation_General@yahoogroups.com, pfink <pfink@...> wrote:
            >
            > mixed_mind_assistance wrote:
            > >
            > > I'm trying to FTP from Fedora Core 4.
            >
            > Try this shell script:
            >
            > #!/bin/sh
            > HOST='ftp.example.com'
            > USER='username'
            > PASSWD='password'
            >
            > ftp -u $HOST <<END_SCRIPT
            > quote USER $USER
            > quote PASS $PASSWD
            > bin
            > hash
            > cd /path/to/target/directory
            > lcd /path/to/source/directory_of_files/getting_backed_up
            > mput myfiles
            > quit
            > END_SCRIPT
            > exit 0
            >


            Thats the one I tried.. but I did not include this portion of the script:

            > ftp -u $HOST <<END_SCRIPT
            > quote USER $USER
            > quote PASS $PASSWD
            > bin
            > hash
            > cd /path/to/target/directory
            > lcd /path/to/source/directory_of_files/getting_backed_up
            > mput myfiles
            > quit
            > END_SCRIPT
            > exit 0
            >

            I'll try that one again, but I *do* believe it fails ..
          • pfink
            ... I just tested it on CentOS and it worked fine, should work on Fedora as well. The script you quoted didn t have the -u switch or the
            Message 5 of 8 , Jun 3, 2006
            • 0 Attachment
              mixed_mind_assistance wrote:
              > --- In LinkStation_General@yahoogroups.com, pfink <pfink@...> wrote:
              >> mixed_mind_assistance wrote:
              >>> I'm trying to FTP from Fedora Core 4.
              >> Try this shell script:
              >>
              >> #!/bin/sh
              >> HOST='ftp.example.com'
              >> USER='username'
              >> PASSWD='password'
              >>
              >> ftp -u $HOST <<END_SCRIPT
              >> quote USER $USER
              >> quote PASS $PASSWD
              >> bin
              >> hash
              >> cd /path/to/target/directory
              >> lcd /path/to/source/directory_of_files/getting_backed_up
              >> mput myfiles
              >> quit
              >> END_SCRIPT
              >> exit 0
              >>
              >
              >
              > Thats the one I tried.. but I did not include this portion of the script:
              >
              >> ftp -u $HOST <<END_SCRIPT
              >> quote USER $USER
              >> quote PASS $PASSWD
              >> bin
              >> hash
              >> cd /path/to/target/directory
              >> lcd /path/to/source/directory_of_files/getting_backed_up
              >> mput myfiles
              >> quit
              >> END_SCRIPT
              >> exit 0


              I just tested it on CentOS and it worked fine, should work
              on Fedora as well.

              The script you quoted didn't have the "-u" switch or the
              <<END_SCRIPT / END_SCRIPT quoting, which are required.

              The "-u" switch stops the FTP client from attempting
              to authenticate immediately, which should prevent the
              Kerberos error. The login is then performed by the
              lines:

              quote USER $USER
              quote PASS $PASSWD
            • mixed_mind_assistance
              ... Hmm.. thats what I was just doing, so I tried doing scripting it differently since it fails on login. I did; ftp -u 192.x.x.x it connects to the box ftp
              Message 6 of 8 , Jun 3, 2006
              • 0 Attachment
                --- In LinkStation_General@yahoogroups.com, pfink <pfink@...> wrote:
                >
                > mixed_mind_assistance wrote:
                > > --- In LinkStation_General@yahoogroups.com, pfink <pfink@> wrote:
                > >> mixed_mind_assistance wrote:
                > >>> I'm trying to FTP from Fedora Core 4.
                > >> Try this shell script:
                > >>
                > >> #!/bin/sh
                > >> HOST='ftp.example.com'
                > >> USER='username'
                > >> PASSWD='password'
                > >>
                > >> ftp -u $HOST <<END_SCRIPT
                > >> quote USER $USER
                > >> quote PASS $PASSWD
                > >> bin
                > >> hash
                > >> cd /path/to/target/directory
                > >> lcd /path/to/source/directory_of_files/getting_backed_up
                > >> mput myfiles
                > >> quit
                > >> END_SCRIPT
                > >> exit 0
                > >>
                > >
                > >
                > > Thats the one I tried.. but I did not include this portion of the
                script:
                > >
                > >> ftp -u $HOST <<END_SCRIPT
                > >> quote USER $USER
                > >> quote PASS $PASSWD
                > >> bin
                > >> hash
                > >> cd /path/to/target/directory
                > >> lcd /path/to/source/directory_of_files/getting_backed_up
                > >> mput myfiles
                > >> quit
                > >> END_SCRIPT
                > >> exit 0
                >
                >
                > I just tested it on CentOS and it worked fine, should work
                > on Fedora as well.
                >
                > The script you quoted didn't have the "-u" switch or the
                > <<END_SCRIPT / END_SCRIPT quoting, which are required.
                >
                > The "-u" switch stops the FTP client from attempting
                > to authenticate immediately, which should prevent the
                > Kerberos error. The login is then performed by the
                > lines:
                >
                > quote USER $USER
                > quote PASS $PASSWD
                >


                Hmm.. thats what I was just doing, so I tried doing scripting it
                differently since it fails on login.

                I did;

                ftp -u 192.x.x.x

                it connects to the box

                ftp>

                if you type user it prompts for a username and if you enter a username
                it prompts for password;

                Password:

                so if I scripted it like

                ftp -u 192.x.x.x
                user username
                mypassword

                it will not continue. Not sure why the script doesn't work, but it
                just fails on the authentication. I can do it manually without a problem.
              • mixed_mind_assistance
                I got it under control now, thanks for your help. I did find that script the other day, I think I know the cause of this. I m using SSH and had port 21 pointed
                Message 7 of 8 , Jun 3, 2006
                • 0 Attachment
                  I got it under control now, thanks for your help. I did find that
                  script the other day, I think I know the cause of this. I'm using SSH
                  and had port 21 pointed back to itself and that caused the errors. I
                  forgot I forwarded port 21 back to the source IP, that is the cause of
                  all the confusion.

                  Its fixed now, ya that script will work.

                  Thx again..
                Your message has been successfully submitted and would be delivered to recipients shortly.