Re: File copy for daily backups



"CBS" <CBS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B3717E3A-8613-4993-9A99-E4013959EEFF@xxxxxxxxxxxxxxxx
: Hi all,
<snip>
: I have a folder which contains two files, both access .mdb files. I would
: like to check to see if the files are in use, and if they are not, then
copy
: them to a specified archive folder. If they are in use, I would like to
bring
: a dialog box up saying so, asking the user to shut down the main database
: before trying again.
<snip>

Here is a script I use to backup our time*** database

dim Filename
dim fso
dim D
D = date
Filename = "E:\" & Right((year(D)*100 + month(D))*100 + day(D), 6) & "
time***.mdb"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.fileexists(Filename) = False Then
fso.CopyFile "R:\Operate\Time***\time***.mdb", Filename
End If
set fso = nothing

With some help from this group, I wrote this to make a unique filename
appended onto our time*** and backup to my CD burner each night. I use
system tools -> scheduled tasks to run the script each weeknight at 6pm.
I use Run: C:\WINNT\system32\CMD.EXE /c cscript.exe Z:\scripts\BackTime.vbs
>c:\mylogs\mylog.txt
Since I am copying the mdb file, it does not matter if anyone is using it or
if there is a lock, it still copies. While I had some problems with Roxio
drivers becoming corrupted, other than that this backup method has worked
great for a year now.
Paul D


.