SMO is a. NET library. Open Visual Studio and choose a Windows application template and provide a nice name for the project. As in the preceding design of the application, when we click the Connect to the Server button there is a window open that asks for the credentials for the SQL database. Another button "Fetch Database" allows fetching of the entire database inside the server that displays the the listbox as in the left side of the list box.
Another and last button is the "Backup Location" button for choosing the destination folder for where we to save the backup file. So I have created an exe file that takes your source code backup automatically.
Use the following procedure to take a daily backup. To do this you can use one of the following two ways:. Source Code using Zip Just don't forget to add a reference for Ionic.
We can do it without the DLL but for that we need the 4. If your source code is more than gb then use the second method. Now the question is, how to execute this exe daily? Windows provides us the feature of the task scheduler to schedule your task. So use the task scheduler to create a task and add your exe to that.
How to schedule a task in the task scheduler? Once the file s are backed up, the archive bit is cleared so we do not back it up again the next time, unless it is actually changed.
This following is the code that I use to save and get the backup sequence number and the increment number:. The following chart tries to show the amount of space we will be saving.
I used files as an example of the total number of files there might be and what percentage of the total are in each size category to calculate the total amount of disk storage that would be used.
This shows that a typical backup is 7. The second set of numbers shows what percentage of each file size category might change every night.
You can change the percentages to explore the various sizes, but I used this as an example. The incremental is only 1. If we were to see what doing a full backup every night would cost, it is a total of These are very good numbers. Now, you can see why tape backup companies have always used these methodologies.
I have not found an example that works for the zip file compression routines. Skip to content. Use the File. Exists "MainFile. WriteAllText "MainFile. Exists "Backup1. WriteAllText "Backup1. Exists "Backup2. WriteAllText "Backup2. ReadAllText "MainFile.
0コメント