Backup file at regular intervals of time from the application

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
<div style="background-color:white; color:black
<pre>HI ,

[/code]

<div style="background-color:white; color:black
<pre> I am trying to back up a file at regular intervals <span style="color:blue in my application .. Currently I am able to back up <span style="color:blue in the below code <span style="color:blue for only one instance

[/code]

<div style="background-color:white; color:black
<pre> <span style="color:blue try



{

File.Copy(<span style="color:#a31515 @"C:original.txt", <span style="color:#a31515 @"C:backup1.txt",<span style="color:blue true );

MessageBox.Show(<span style="color:#a31515 "Backup Completed");

}



<span style="color:blue catch (Exception ee)

{

MessageBox.Show(ee.Message);

}

[/code]

In my application , this file is database file. (.sdf ). So only this part I want to take the back up .But I want to back up this file every 1 hr , example... I have the original file , now I back up as backup1 , after 1 hr , I would like
to do again a backup , now I need to overwrite backup1 with the new backups at the new time. In simple words, I would like to have new backup every 1 hr. This I am doing, so that if my application crashes , I could ensure the data is safe in the
backup.
Could anyone help me out in this issue please .
Thanks,
Pavan


View the full article
 
Back
Top