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

Re: HGLAN Boxes

Expand Messages
  • lalunas10
    ... Tom, It would be trivial to set up a cron job and run rsync , oder roll a tar ball over the network using netcat ! You would probably better have root
    Message 1 of 5 , Oct 11, 2005
    • 0 Attachment
      --- In LinkStation_General@yahoogroups.com, Tom Harbin <tharbin@t...> wrote:

      > I like these boxes but I need an off-the-shelf station-to-station
      > (actually just network based so that it can run through a VPN) backup or
      > even better, synchronization. I hate to go with SNAP Servers since I
      > think they are gouging the market.

      Tom,

      It would be trivial to set up a cron job and run "rsync", oder roll a "tar"ball over the
      network using "netcat"! You would probably better have root access to the devices though
      in order not to not run into permission problems.

      A simple setup could look like this:

      1. Install "rsync" on both machines, into /usr/local/bin/. Let's call the boxes "target" and
      "source" for now, you better use the IP addresses instead of the names.

      2. Enable passwordless ssh login on both machines. As root,

      ssh-keygen -t dsa # empty password

      ssh-keygen -t rsa # empty password

      Make sure root login over ssh is permitted in /etc/ssh/sshd (or dropbear isn't started "-
      w").

      Then, on both machines respectively, here just one way shown:

      scp ~/.ssh/*pub target:/tmp/ # we're on source

      ssh target # we go to target

      cat /tmp/*pub > ~/.ssh/authorized_keys # we're on target

      Passwordless but secure ssh login in both directions should now be possible. You might
      want to disable password login in /etc/ssh/sshd.conf once everything works.

      3. The sync process:

      on target:

      mkdir /mnt/backup # the target must be on the "large" partition, you need to do this
      only once

      on source:

      rsync -avze ssh / target:/mnt/backup/ # make a test backup

      If it works, put this in source's /etc/crontab:

      0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
      2>&1

      (another oneliner; if this doesn't work, you need to explicitely specify something like

      SHELL=/bin/sh

      PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

      0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
      2>&1

      in source's /etc/crontab)

      This would backup the entire source box ("/"), with a few errors you can safely ignore, into
      target's "/mnt/backup/" folder, every day on "high noon" :)

      -Andre
    • lalunas10
      ... though ... into ... All this might have side effects when syncing in both directions. Replace every occourcene of rsync with rsync --exclude
      Message 2 of 5 , Oct 11, 2005
      • 0 Attachment
        --- In LinkStation_General@yahoogroups.com, "lalunas10" <lalunas10@y...> wrote:
        >
        > --- In LinkStation_General@yahoogroups.com, Tom Harbin <tharbin@t...> wrote:
        >
        > > I like these boxes but I need an off-the-shelf station-to-station
        > > (actually just network based so that it can run through a VPN) backup or
        > > even better, synchronization. I hate to go with SNAP Servers since I
        > > think they are gouging the market.
        >
        > Tom,
        >
        > It would be trivial to set up a cron job and run "rsync", oder roll a "tar"ball over the
        > network using "netcat"! You would probably better have root access to the devices
        though
        > in order not to not run into permission problems.
        >
        > A simple setup could look like this:
        >
        > 1. Install "rsync" on both machines, into /usr/local/bin/. Let's call the boxes "target" and
        > "source" for now, you better use the IP addresses instead of the names.
        >
        > 2. Enable passwordless ssh login on both machines. As root,
        >
        > ssh-keygen -t dsa # empty password
        >
        > ssh-keygen -t rsa # empty password
        >
        > Make sure root login over ssh is permitted in /etc/ssh/sshd (or dropbear isn't started "-
        > w").
        >
        > Then, on both machines respectively, here just one way shown:
        >
        > scp ~/.ssh/*pub target:/tmp/ # we're on source
        >
        > ssh target # we go to target
        >
        > cat /tmp/*pub > ~/.ssh/authorized_keys # we're on target
        >
        > Passwordless but secure ssh login in both directions should now be possible. You might
        > want to disable password login in /etc/ssh/sshd.conf once everything works.
        >
        > 3. The sync process:
        >
        > on target:
        >
        > mkdir /mnt/backup # the target must be on the "large" partition, you need to do this
        > only once
        >
        > on source:
        >
        > rsync -avze ssh / target:/mnt/backup/ # make a test backup
        >
        > If it works, put this in source's /etc/crontab:
        >
        > 0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
        > 2>&1
        >
        > (another oneliner; if this doesn't work, you need to explicitely specify something like
        >
        > SHELL=/bin/sh
        >
        > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
        >
        > 0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
        > 2>&1
        >
        > in source's /etc/crontab)
        >
        > This would backup the entire source box ("/"), with a few errors you can safely ignore,
        into
        > target's "/mnt/backup/" folder, every day on "high noon" :)

        All this might have side effects when syncing in both directions. Replace every occourcene
        of "rsync" with "rsync --exclude '/mnt/backup' " !

        0 12 * * * root /usr/local/bin/rsync --exclude '/mnt/backup/' -avze ssh / target:/
        mnt/backup/ > /dev/null > 2>&1

        -Andre
      • prb0x
        ... backup or ... a tar ball over the ... to the devices though ... call the boxes target and ... dropbear isn t started - ... possible. You might ...
        Message 3 of 5 , Oct 12, 2005
        • 0 Attachment
          --- In LinkStation_General@yahoogroups.com, "lalunas10"
          <lalunas10@y...> wrote:
          >
          > --- In LinkStation_General@yahoogroups.com, Tom Harbin
          <tharbin@t...> wrote:
          >
          > > I like these boxes but I need an off-the-shelf station-to-station
          > > (actually just network based so that it can run through a VPN)
          backup or
          > > even better, synchronization. I hate to go with SNAP Servers since I
          > > think they are gouging the market.
          >
          > Tom,
          >
          > It would be trivial to set up a cron job and run "rsync", oder roll
          a "tar"ball over the
          > network using "netcat"! You would probably better have root access
          to the devices though
          > in order not to not run into permission problems.
          >
          > A simple setup could look like this:
          >
          > 1. Install "rsync" on both machines, into /usr/local/bin/. Let's
          call the boxes "target" and
          > "source" for now, you better use the IP addresses instead of the names.
          >
          > 2. Enable passwordless ssh login on both machines. As root,
          >
          > ssh-keygen -t dsa # empty password
          >
          > ssh-keygen -t rsa # empty password
          >
          > Make sure root login over ssh is permitted in /etc/ssh/sshd (or
          dropbear isn't started "-
          > w").
          >
          > Then, on both machines respectively, here just one way shown:
          >
          > scp ~/.ssh/*pub target:/tmp/ # we're on source
          >
          > ssh target # we go to target
          >
          > cat /tmp/*pub > ~/.ssh/authorized_keys # we're on target
          >
          > Passwordless but secure ssh login in both directions should now be
          possible. You might
          > want to disable password login in /etc/ssh/sshd.conf once everything
          works.
          >
          > 3. The sync process:
          >
          > on target:
          >
          > mkdir /mnt/backup # the target must be on the "large" partition,
          you need to do this
          > only once
          >
          > on source:
          >
          > rsync -avze ssh / target:/mnt/backup/ # make a test backup
          >

          What's the reasoning for using rsync over SSH? Surely there is a
          performance hit involved. If the sync is happening on the LAN it's
          safe enough not to have to use any encryption.

          Cheers,
          Al
        • Tom Harbin
          ... Andre, Thanks, this is good approach. I wanted to leave the boxes stock , since I m in Arizona and the other box will be in California. I wanted to be
          Message 4 of 5 , Oct 12, 2005
          • 0 Attachment
            lalunas10 wrote:

            >--- In LinkStation_General@yahoogroups.com, "lalunas10" <lalunas10@y...> wrote:
            >
            >
            >>--- In LinkStation_General@yahoogroups.com, Tom Harbin <tharbin@t...> wrote:
            >>
            >>
            >>
            >>>I like these boxes but I need an off-the-shelf station-to-station
            >>>(actually just network based so that it can run through a VPN) backup or
            >>>even better, synchronization. I hate to go with SNAP Servers since I
            >>>think they are gouging the market.
            >>>
            >>>
            >>Tom,
            >>
            >>It would be trivial to set up a cron job and run "rsync", oder roll a "tar"ball over the
            >>network using "netcat"! You would probably better have root access to the devices
            >>
            >>
            >though
            >
            >
            >>in order not to not run into permission problems.
            >>
            >>A simple setup could look like this:
            >>
            >>1. Install "rsync" on both machines, into /usr/local/bin/. Let's call the boxes "target" and
            >>"source" for now, you better use the IP addresses instead of the names.
            >>
            >>2. Enable passwordless ssh login on both machines. As root,
            >>
            >> ssh-keygen -t dsa # empty password
            >>
            >> ssh-keygen -t rsa # empty password
            >>
            >>Make sure root login over ssh is permitted in /etc/ssh/sshd (or dropbear isn't started "-
            >>w").
            >>
            >>Then, on both machines respectively, here just one way shown:
            >>
            >> scp ~/.ssh/*pub target:/tmp/ # we're on source
            >>
            >> ssh target # we go to target
            >>
            >> cat /tmp/*pub > ~/.ssh/authorized_keys # we're on target
            >>
            >>Passwordless but secure ssh login in both directions should now be possible. You might
            >>want to disable password login in /etc/ssh/sshd.conf once everything works.
            >>
            >>3. The sync process:
            >>
            >>on target:
            >>
            >> mkdir /mnt/backup # the target must be on the "large" partition, you need to do this
            >>only once
            >>
            >>on source:
            >>
            >> rsync -avze ssh / target:/mnt/backup/ # make a test backup
            >>
            >>If it works, put this in source's /etc/crontab:
            >>
            >> 0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
            >>2>&1
            >>
            >>(another oneliner; if this doesn't work, you need to explicitely specify something like
            >>
            >> SHELL=/bin/sh
            >>
            >> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
            >>
            >> 0 12 * * * root /usr/local/bin/rsync -avze ssh / target:/mnt/backup/ > /dev/null
            >>2>&1
            >>
            >>in source's /etc/crontab)
            >>
            >>This would backup the entire source box ("/"), with a few errors you can safely ignore,
            >>
            >>
            >into
            >
            >
            >>target's "/mnt/backup/" folder, every day on "high noon" :)
            >>
            >>
            >
            >All this might have side effects when syncing in both directions. Replace every occourcene
            >of "rsync" with "rsync --exclude '/mnt/backup' " !
            >
            > 0 12 * * * root /usr/local/bin/rsync --exclude '/mnt/backup/' -avze ssh / target:/
            >mnt/backup/ > /dev/null > 2>&1
            >
            >-Andre
            >
            >
            >
            >
            >
            Andre,

            Thanks, this is good approach. I wanted to leave the boxes "stock",
            since I'm in Arizona and the other box will be in California. I wanted
            to be able to just have them direct ship a replacement if theirs went
            down but rsyncing the boxes just makes so much sense. Question: won't
            running the connection through SSH over the VPN mean that I am double
            encrypting the data?

            Tom Harbin
          Your message has been successfully submitted and would be delivered to recipients shortly.