How to manually modify the default OneSource backup script to backup distributed databases
- Create a backup script following the steps above.
- Right click on the newly created script and click Edit.
- Make a new FOLDER to store your backups. In this example the new folder created was: C:\OneSource\LocalScriptBackups\ (Also, note that the place that says YourCompanyDataFile below needs to be replaced by the name of your company data file).
- Modify the file (or copy and paste the data below into the file) so it looks like the code below:
Dim fromfile
Dim tofile
Dim mytime
Dim p
Dim p1
Dim mm
Dim dd
Dim yyyy
Dim t
Dim strWSH
aDate = Date
t = Int(Timer)
p = InStr(aDate, "/")
mm = Right("0" & Left(aDate, p - 1), 2)
p1 = InStr(p + 1, aDate, "/")
dd = Right("0" & Mid(aDate, p + 1, (p1 - p) - 1), 2)
yyyy = Right(aDate, 4)
MsgBox "This Proccess Will Make A Disk-To-Disk Backup Copy Of The Specified File(s)."
Set FS = CreateObject("Scripting.FileSystemObject")
fromfile = "C:\OneSource\Data\YourCompanyDataFile.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "NationalAutoParts.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osap.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osap.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osar.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osar.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osbk.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osbk.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\oscsa.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "oscsa.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osgl.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osgl.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osicm.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osicm.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osinv1.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osinv1.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osinv2.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osinv2.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\oslog.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "oslog.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osonlineorders.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osonlineorders.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\ospo.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "ospo.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\osqu.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "osqu.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
fromfile = "C:\OneSource\Data\ossa.mdb"
tofile = "C:\OneSource\LocalScriptBackups\" & yyyy & mm & dd & "." & "ossa.mdb." & t & ".BAK"
FS.CopyFile fromfile, tofile
MsgBox "Disk-To-Disk Backup Process Complete."