Automatic File Recovery

Discussion in 'General Server' started by Dre, Aug 22, 2014.

  1. Dre

    Dre New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I am trying to implement a back up system that will automatically sync with a new machine that falls within my specified criteria. An example of what I want would be any new server booting on a specific ip range would automatically download the files from my host server. I currently use Rsync for my back ups with a cron job to automate them. I have no ideas as to any tools or different possible ways to make this idea possible. Any suggestions or advice would be greatly appreciated.

  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,260
    Likes Received:
    428
    Trophy Points:
    83
    Is rsync and a cron job not working correctly?
  3. WharfRat

    WharfRat New Member

    Messages:
    28
    Likes Received:
    10
    Trophy Points:
    3
    From a periodic cron job you can check your ip range and use rsync via ssh or nfs. A crude outline would be something like

    Code:
    for i in {100..110}; do
        # for ssh
      ping -c1 -w1 192.168.1.${i} >/dev/null
      if [ $? -eq 0 ];then
        #do your stuff
      fi
        # for nfs
      if rpcinfo -p 192.168.1.${i} | grep "nfs" &>/dev/null; then
        #do your stuff
      fi
    done
    You could probably ping with nfs, but it might be better to check for nfs connectivity.
    icehouse15 likes this.
  4. Dre

    Dre New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    My rsync and cron job are working perfectly. What I am trying to do is a little different though. I have set up my apache server with some files on it. I am trying to figure out a way to have the files on my apache server automatically be sent to any new server that boots that is under my range (inside my ip range). So as soon as a new server boots it would communicate with my apache server and automatically download the necessary files without and user intervention.

Share This Page