Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the schedule job of backing large files in Windows Server and it takes almost 2 hours to finish.

For now, I only use copy command in the .bat and copy the large files to another folder.

I'm wondering whether there is more efficient way than the copy command to backup the large files(approximately 90GB). For example, write an c++ program to copy the files rather than the copy command.

Many thanks.

share|improve this question

migrated from stackoverflow.com Jul 20 '12 at 17:12

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

2  
Do all these files change every day? Have you considered an incremental backup using something like rsync? –  Thilo Jul 20 '12 at 3:47
    
What types of files are these? Are these large binary files like pictures and videos? Or are these large text files like csv files, spreadsheets, etc? Is each file you are backing up approx. 90GB or is the entire backup approx. 90GB? –  Crackers Jul 20 '12 at 3:52
add comment

4 Answers 4

up vote 2 down vote accepted

The copy command you're using is likely already written in C++ or C, or even with lower-level routines, so you won't really see any speed gains by simply using existing copy functions or methods in those languages.

share|improve this answer
add comment

You will be disk bound. Most likely the language/mechanism will be the same in the end (system calls). The fastest way is to upgrade disks to higher RPM and/or use a striped RAID configuration.

But make sure you are copying between two seperate physical drives. (i.e. reading from one and writing to the other).

If possible, just save the changes (deltas), not the whole file, perhaps every week doing a full backup. Also if the files are well suited to compression (e.g plain text), then compressing prior to writing to disk will be much faster.

share|improve this answer
add comment

If you need to preserve file ACLs, consider xcopy or robocopy. I used it to mirror almost 600 GB of data from 2 different disk (400GB + 200GB) to a backup disk. Daily changes are almost 2GB (mostly small files) and finished copying in 45 minutes. The initial mirroring will take some time proportional to your data.

If need not preserve the ACLs, Terracopy will be faster

share|improve this answer
add comment

If the problem is the two hour downtime window while you back up the files, you might:

1. Move the files elsewhere on the same disk/array.

Provided you dont cross onto another disk, the move should be almost immediate. Requires diskspace. After the move, you should be able to restart the process that writes to these files, with just a few minutes of lag. You back up the moved files.

2. Rename the files

The files remain in the same spot, but have a different name.

You can rename the files. Requires diskspace. After the move, you should be able to restart the process that writes to these files, with just a few minutes of lag. You back up the renamed files.

3. Archive the files before backing them up

If these large files can be compressed, you may gain both time in backing them up, and you'll use less tape, for a double savings. Be sure to choose a good archiving program.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.