Solved

How to take incremental backup of a file.

Posted on 2009-07-08
8
246 Views
Last Modified: 2013-12-14
Hello Sir,

How to take incremental backup of a file on Window's XP using VC++. Please tell me any method or source code which take full backup of a file when it will be created and for the rest of days it only take backup of changes made in file. Please help me out.

Thanks & Regards
0
Comment
Question by:davinder101
  • 5
  • 3
8 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24812484
Why do you want reinvent the wheel?

There is enough software - also for free - which does what you want.

Why not using them?
0
 

Author Comment

by:davinder101
ID: 24812912
I don't want to use other's software i want to make my own program which will take incremental backup of file, i downloaded so many software's but all of them are taking backup of full file every time even there is small changes in file. Please tell me any method or code in VC++ which i can use in my program.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
ID: 24813389
You could use RCS for making deltas between files.

See http://www.gnu.org/software/rcs/

For copying files either use CopyFile from WINAPI or make your own copy via stat, ifstream::open, ifstream::read, ofstream::open, ofstream::write, ifstream::close, ofstream::close.

The stat would give the filesize, while the stream functions would read/write the total file in binary mode to output folder.

For writing or keeping timestamps use SetFileTime. There are (older) DOS functions as well for file times but I don't know whether they still were supported by Windows and NTFS.

To search in folders and subfolders use FindFirstFile and FindNextFile recursively.  
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24813452
>>>> I don't want to use other's software

Note, instead of backup software you might consider a versioning and configuration tool. SourceSafe is for free with Visual C++ pro but you also may use a free tool like cvs or reflection. Contrary to backup systems, versioning tools generally store deltas. They automatically create a full file version if the deltas were too many or need more space than the original file.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:davinder101
ID: 24837532
How to use RCS on Window's XP using VC++ to make program for incremental backup.
0
 

Author Comment

by:davinder101
ID: 24837658
RCS is mainly develop for UNIX system and i want to make program for Window's system. So please tell me any method or code to take incremental backup on Window's.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24941136
>>>> RCS is mainly develop for UNIX system and i want to make program for Window's system.

I have seen a few Windows implementations of versioning systems based on pure RCS. I will make some investigations for free RCS libraries for Windows.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24941143
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now