Click here to Skip to main content
15,890,932 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create automated backup files in 30 days and backup type compress.
But I want to backup the folder containing Data Files (.doc,.xls,.tiff,.pdf...) but not sql database.

Thank You.
Posted
Updated 12-Jul-22 9:49am
Comments
Sergey Alexandrovich Kryukov 23-Dec-13 21:55pm    
In 30 days? Impossible. The known algorithms can only do it for 31 day. :-)
Seriously, this is not a good question. What do you mean "how"? By doing some programming work.
Any particular concerns? Anything where a Quick Answer can really help?

And what, VB, or VB.NET?

—SA

Please see my comment to the question: what do you mean "how"? Do some work.

You can collect all files in some directory, recursively, using, one of these methods: http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles%28v=vs.110%29.aspx[^].

With your file type it won't be a problem, but, just in case, be aware of one delicate problem I described in my past answer: Directory.Get.Files search pattern problem[^].

You can compress all the files in one somehow. In particular, you can ZIP them using one of the libraries. Please see my past answers:
Compare between two folders[^],
Extract file rar with vb.net[^].

See also this one: http://sharpcompress.codeplex.com[^].

Something like that. This is more of a work to be done; there is nothing special which requires some special advice, but you need to do the job by yourself. Any specific concerns? Anything else, where a Quick Answer could help?

—SA
 
Share this answer
 
Comments
jex_y2k 27-Dec-13 3:41am    
I Want file Backup SHARE-AC.zip. But now have get folder SHARE-AC don't zip
Sergey Alexandrovich Kryukov 27-Dec-13 11:01am    
I don't understand. Didn't I explain how to ZIP? Use one of the libraries, and perform compression.
—SA
I Want file Backup SHARE-AC.zip. But now have get folder SHARE-AC don't zip


VB
Imports System.IO
Imports System.IO.Compression
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim dstr As String
        Dim mstr As String
        Dim ystr As String
        Dim folstr As String
        Dim dsumstr As String

        dstr = DateTime.Today.ToString("dd")
        mstr = DateTime.Today.ToString("MM")
        ystr = DateTime.Today.ToString("yyyy")
        dsumstr = ystr & "-" & mstr & "-" & dstr
        folstr = "Y:\server1\Fileserver-" & dsumstr
        Try
            My.Computer.FileSystem.CreateDirectory(folstr)

            My.Computer.FileSystem.CreateDirectory(folstr & "\SHARE-AC")
            My.Computer.FileSystem.CopyDirectory("D:\SHARE-AC", folstr & "\SHARE-AC")

           

            Label1.Text = "Back up DATE   " & dsumstr & "  Complete"
        Catch ex As Exception
            Label1.Text = (ex.Message)
        End Try

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
End Class
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900