Automatic File Recovery

D

Dre

Guest
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.
 


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.
 
Is rsync and a cron job not working correctly?
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.
 

Members online


Top