up vote 0 down vote favorite
share [g+] share [fb]

I was wondering if there was a way of backuping the files from one harddrive, to two or three other harddrives simultaneously (connections will be over firewire and be done off a laptop), so that there is only one read to two writes?

I was thinking about a custom bash script something like cat /location/to/file/a.ext | tee /backupharddrive/location/to/file/a.ext > /backupharddriveb/location/to/file/a.ext but it seemed to be of the same performance as if i were to copy them separately

Cheers

link|improve this question
2  
This is more of a superuser kind of question. – cletus Oct 1 '09 at 2:31
Try using two bash scripts (one to each drive); or, RAID. – ChrisW Oct 1 '09 at 2:32
feedback

migrated from stackoverflow.com Oct 1 '09 at 2:35

This question came from our site for professional and enthusiast programmers.

2 Answers

Why not use RSync?

Pseudo Code (not guaranteed to be accurate at all!)

foreach hard_drive_device
     rsync source_dir $hard_drive_device/dest_dir
fi

Granted this is not asynchronous but would achieve your task. You could put a & at the end if you want to fork the process into the background

Or using the old hacker philosophy: scratch your own itch!

You could create a program in your favourite language called multicopy that takes one read source and then writes to many destinations

Pseudo Code (not guaranteed to be accurate at all!)

if(src is directory)
  for each file in directory
    CopyFile(file, destList)
  fi
else
  CopyFile(src, destList)
fi

CopyFile(src, destList) {
 foreach block in src
    foreach dest in destList
        open(dest/src)
        seek(end)
        write(block)
    fi
 fi
}
link|improve this answer
feedback

The setup requires separate hard drives... not raid configurations...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown