473,508 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need example of backing up disk....

jim
I'd like to get some .net sample code that shows me how to make a complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.

Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.

Any help or links you could provide would be greatly appreciated. (Please
include your name to be added to the credits screen in the free
application.)

jim
Jun 27 '08 #1
12 1418
Please don't cross-post so liberally. It is especially inappropriate to
cross-post between two different language groups. If you really want
language-agnostic advice, pick a non-language-specific newsgroup (like
m.p.d.framework) and post your question there. (follow-ups to C#
newsgroup)

As for your specific question:

On Thu, 22 May 2008 16:21:08 -0700, jim <ji*@home.netwrote:
I'd like to get some .net sample code that shows me how to make a
complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.
No doubt there's lots of different approaches to something like this.
However, assuming you're just going to do a simple file-by-file transfer,
you might want to look at the classes in System.IO, including File and
Directory. Those support operations like enumerating the files and
directories in the file system, and copying a file from one place to
another.

Your stipulation of "while the drive is in use" complicates things,
because of the possibility that a file may be in use and thus not able to
be copied. One approach to dealing with that is to maintain a list of
files that you come across like that, and try them again later. To some
extent it's an unresolvable problem, so I'm not sure it'd be worthwhile to
do anything more complicated than that. In fact, you may simply just want
to report to the user and leave it at that.

If you are intending to archive files into a single large file, then you
may also want to look at classes like FileStream and GZipStream (the
latter for making an attempt to compress the input...if you have a lot of
compressible files, like HTML, XML, etc. then this optional feature might
be worth looking into).

No need to give credit, IMHO. The newsgroup is available for all, with
advice given freely. By asking a question here, you help others as much
as yourself, as someone else may later come looking for the answer to the
same question. A person would have to invest a lot more effort than just
answering a quick question in the newsgroup to warrant being credited in
some specific software. Otherwise, by that metric I suspect that a number
of us are being left out being credited for helping with a fairly broad
selection of programs (there are at least a dozen people who regularly
answer non-trivial questions here, and probably another dozen or two who
do so infrequently, and as far as I know, none of us are ever explicitly
credited in whatever final product was being developed). :)

Pete
Jun 27 '08 #2
Jim,

I don't think that any version of VB is the right programma language, as in
fact not any managed language.

Maybe raw C can help you or otherwise Intel Assembler.

Just my opinion,

Cor

"jim" <ji*@home.netschreef in bericht
news:oc*****************@bignews5.bellsouth.net...
I'd like to get some .net sample code that shows me how to make a complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.

Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.

Any help or links you could provide would be greatly appreciated. (Please
include your name to be added to the credits screen in the free
application.)

jim
Jun 27 '08 #3
So you want to make software that you do not know how to make to be better
then Acronis which is actually relatively stable? im so lost on your logic..

"jim" <ji*@home.netwrote in message
news:oc*****************@bignews5.bellsouth.net...
I'd like to get some .net sample code that shows me how to make a complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.

Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.

Any help or links you could provide would be greatly appreciated. (Please
include your name to be added to the credits screen in the free
application.)

jim

Jun 27 '08 #4
"Cor Ligthert[MVP]" wrote:
Jim,

I don't think that any version of VB is the right programma language, as in
fact not any managed language.

Maybe raw C can help you or otherwise Intel Assembler.

Just my opinion,

Cor
Cor -
IMHO the appropriate language is the language the programmer choses to
do the application in. VB isn't inherently wrong and C isn't
inherently right. Yes he wants to back things up [IO intensive and
Richter puts that whole issue to bed, along with the simple sense of
how the different paradigms get executed] but I doubt that is the only
requirement. Right language is decided in the totality of the design
and in consideration of all the requirements. (His first stated
requirement is vengeance - that is a language agnostic goal) There
were C neanderthals who said I couldn't do a "real-time" app in VB.
Done, delivered and still being used by a major manufacturing
organization to handle toxic chemicals. Once the definitions were
understood it met and exceeded all requirements. Cutting to the
chase, language snobbery doesn't elevate the art of programming which
is how I see these forums. Answering the question as Peter did does.
>
"jim" <j...@home.netschreef in berichtnews:oc*****************@bignews5.bellsouth .net...
I'd like to get some .net sample code that shows me how to make a complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.
Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.
Any help or links you could provide would be greatly appreciated. (Please
include your name to be added to the credits screen in the free
application.)
jim
Jim -

I recently finished a utlity that handles backing up things in a very
simplistic manner as you seem to be asking. I did it using the
facilities Peter described, I also took a couple of ideas from another
Site (Code Project) and use a pie chart as a progress bar just for
giggles. Motivation is good but have some fun along the way.
Jun 27 '08 #5
Ben,

This has nothing to do with preference, as you want to make a complete
immage of a drive, despite of all security options, despite of what is
happening in that time, then you have to use software that is not running on
the OS level.

Just my opinion.

Cor

"Ben white" <pg***********@gmail.comschreef in bericht
news:93**********************************@m3g2000h sc.googlegroups.com...
"Cor Ligthert[MVP]" wrote:
>Jim,

I don't think that any version of VB is the right programma language, as
in
fact not any managed language.

Maybe raw C can help you or otherwise Intel Assembler.

Just my opinion,

Cor
Cor -
IMHO the appropriate language is the language the programmer choses to
do the application in. VB isn't inherently wrong and C isn't
inherently right. Yes he wants to back things up [IO intensive and
Richter puts that whole issue to bed, along with the simple sense of
how the different paradigms get executed] but I doubt that is the only
requirement. Right language is decided in the totality of the design
and in consideration of all the requirements. (His first stated
requirement is vengeance - that is a language agnostic goal) There
were C neanderthals who said I couldn't do a "real-time" app in VB.
Done, delivered and still being used by a major manufacturing
organization to handle toxic chemicals. Once the definitions were
understood it met and exceeded all requirements. Cutting to the
chase, language snobbery doesn't elevate the art of programming which
is how I see these forums. Answering the question as Peter did does.
>>
"jim" <j...@home.netschreef in
berichtnews:oc*****************@bignews5.bellsout h.net...
I'd like to get some .net sample code that shows me how to make a
complete
backup of a hard drive (like my C: drive) to another location (say my
D:
drive) while the C: drive is in use.
Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.
Any help or links you could provide would be greatly appreciated.
(Please
include your name to be added to the credits screen in the free
application.)
jim

Jim -

I recently finished a utlity that handles backing up things in a very
simplistic manner as you seem to be asking. I did it using the
facilities Peter described, I also took a couple of ideas from another
Site (Code Project) and use a pie chart as a progress bar just for
giggles. Motivation is good but have some fun along the way.
Jun 27 '08 #6
On Fri, 23 May 2008 10:17:47 -0700, Cor Ligthert[MVP]
<no************@planet.nlwrote:
This has nothing to do with preference, as you want to make a complete
immage of a drive, despite of all security options, despite of what is
happening in that time, then you have to use software that is not
running on the OS level.
He said he wants to back up the disk while it's in use. No imaging
utility is going to do that. You need to be able to lock the whole disk
to make an image. No sane person would try to image a disk _while_ the
data on that disk is being modified, and at least for the moment I'm going
to assume that the OP is sane (I don't see anything in the headers to
suggest he's posting from a psychiatric ward :) ).

It seems to me that you're reading more into his question than is
justified.

But beyond that, even if he did want to write an disk imaging utility,
there's nothing fundamentally impossible or even undesirable about using
C# to do it. Some p/invoke would surely be required to do the lower-level
stuff, but "raw C" or "assembler" are absolutely not required, or even
necessarily desirable, for a task like that.

Pete
Jun 27 '08 #7
jim
Admitting that I \have never written backup software, I have written many
hundreds of applications in VB, VB.Net and some older languages like Turbo
Pascal.

In asking for the source code, I was hoping to accomplish 2 main things.
(1) To learn more about a process than I currently know and (2) get a head
start on the project.

As for you r ability to follow the logic therein.....well, you can do what
you can do.

jim

"Smokey Grindel" <no****@nospam.comwrote in message
news:uM**************@TK2MSFTNGP05.phx.gbl...
So you want to make software that you do not know how to make to be better
then Acronis which is actually relatively stable? im so lost on your
logic..

"jim" <ji*@home.netwrote in message
news:oc*****************@bignews5.bellsouth.net...
>I'd like to get some .net sample code that shows me how to make a
complete backup of a hard drive (like my C: drive) to another location
(say my D: drive) while the C: drive is in use.

Basically, I'd like to make and give away free backup software because
Acronis has given me so many problems.

Any help or links you could provide would be greatly appreciated.
(Please include your name to be added to the credits screen in the free
application.)

jim


Jun 27 '08 #8
jim

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Fri, 23 May 2008 10:17:47 -0700, Cor Ligthert[MVP]
<no************@planet.nlwrote:
>This has nothing to do with preference, as you want to make a complete
immage of a drive, despite of all security options, despite of what is
happening in that time, then you have to use software that is not
running on the OS level.

He said he wants to back up the disk while it's in use. No imaging
utility is going to do that. You need to be able to lock the whole disk
to make an image. No sane person would try to image a disk _while_ the
data on that disk is being modified, and at least for the moment I'm going
to assume that the OP is sane (I don't see anything in the headers to
suggest he's posting from a psychiatric ward :) ).
I will leave it to others to judge my sanoty.

But, as for your statements about what is possible, you are mistaken. When
Acronis True Image works as it should, it backs up everything on the whole
partition. That includes OS files even while the OS is in use. It runs
from Windows and backs up Windows as it is runnig from within the OS.

The problem that I am having with it presently isn't backing things up as
much as it not deleting old copies as it should when the drive being used
for backups is filled. The software supposedly does this, but I am having
problems on a great many PCs using this feature.

Talking to Acronis is difficult at best and is just an exercise in
frustration. So, getting them to fix the issue is not very likely.

Hence, I'd like to make a simple app that backs up the entire drive (even
while in use - if they do it, it can be done) to another location and delete
old copies when the destination location is too full to accept a new image.

Acronis TrueImage 11 says it does those things, but I can show you 10 or 20
PCs where it does not work as advertised.

I am tired of trying to contact a living breathing person at Acronis (seems
they really dont give a fvck about you after the sale) and I'd like to give
away my app to keep more people from falling prey to Acronis' promises that
it can't back up.

Thanks again!

jim
Jun 27 '08 #9
jim wrote:
But, as for your statements about what is possible, you are mistaken. When
Acronis True Image works as it should, it backs up everything on the whole
partition. That includes OS files even while the OS is in use. It runs
from Windows and backs up Windows as it is runnig from within the OS.
Most operating systems has low level calls to read files even
though they are in use.

But there are not much point. Unless it is a log based file
system, then the open files can be be corrupt/inconsistent
in the created image.

And no - NTFS is not a real log based file system.

Arne
Jun 27 '08 #10
Hate to see a person without help when they ask. Can you give me some
idea of where you are and where your "blind spots" are?

Jun 27 '08 #11
jim

"Ben white" <pg***********@gmail.comwrote in message
news:3e**********************************@79g2000h sk.googlegroups.com...
Hate to see a person without help when they ask. Can you give me some
idea of where you are and where your "blind spots" are?
I am wondering how to back up in-use files. I am currently looking into
using Windows Shadow Copy service - but that will only work if it is
installed and endabled. Perhaps there is a way for me to install or enable
it if it is not enabled.....still looking.

Thanks!
Jun 27 '08 #12
On May 29, 1:58 am, "jim" <j...@home.netwrote:
"Ben white" <pgwichtend...@gmail.comwrote in message

news:3e**********************************@79g2000h sk.googlegroups.com...
Hate to see a person without help when they ask. Can you give me some
idea of where you are and where your "blind spots" are?

I am wondering how to back up in-use files. I am currently looking into
using Windows Shadow Copy service - but that will only work if it is
installed and endabled. Perhaps there is a way for me to install or enable
it if it is not enabled.....still looking.

Thanks!
Jim,
If your intention is to programme through Volume Shadow Copy Service,
you shouldn't worry about the service's running status, you can
start / stop or query status using servicecontroller component in your
toolbox:

' Check status and start if service is not running:
' First set ServiceName property to "VSS"
' srvcontroller is your component name here
If Not srvcontroller.Status =
ServiceProcess.ServiceControllerStatus.Running Then
srvcontroller.Start()
End If

Hope this makes sense,

Onur Güzel
Jun 27 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1948
by: mark | last post by:
Hi I'm hoping that some could point me in the right direction for "best practice" in: 1) securely backing up a complete sql7 and 2000 server containing many databases. 2) backing up an...
3
1556
by: war_wheelan | last post by:
I am having a problem backing up my database and TLog files due to a lack of local diskspace. The db file is about 30GB and the TLog is about 20GB each on a different hard disk. Each disk doesn't...
7
1813
by: Les Coover | last post by:
I have struggled and struggled with this and still can not get it. The endless loop is supposed to be that way so that strings can be entered over and over again. When finished CTRL + C returns...
3
1191
by: Scott Marlowe | last post by:
I'm wondering if there's some basic failing in how we're presenting backing up the database on a regular basis. Maybe even our reputation for reliability hurts a bit here. I'm sure if...
5
3218
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup...
7
2276
by: elgiei | last post by:
Good morning at all, i have to implement a server,that every n-seconds (eg. 10sec) sends to other clients,which files and directory has been deleted or modified. i build a n-tree, for each...
1
2336
by: Bryan | last post by:
Every time i try to back up a specific DB i get an error saying it can not backup because the full text catalog is not permitted because it is not online. It does not matter if i try to backup the...
9
1090
by: jim | last post by:
I'd like to get some .net sample code that shows me how to make a complete backup of a hard drive (like my C: drive) to another location (say my D: drive) while the C: drive is in use. ...
0
1005
by: =?Utf-8?B?ZGVsdWNhMmI=?= | last post by:
I'm running XP home SP3. I want to backup my system but my laptop only came with a recovery disk (no ntbackup.exe file). How can I do this-and I only have a CD drive (I know I can't use CD's) and...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.