Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering if there was a way of backing up the files from one hard drive, to two or three other hard drives 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

share|improve this question

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

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

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

2 Answers 2

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
}
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.