The company i work for uses xcopy to copy our server files and folders to a backup folder every night, this process takes anywhere from 45 mins to 1hr 20 mins, other than trying robocopy or xcopy does anyone have a better more efficient ( faster ) idea or way that they do things to copy large tables/files/folders to a backup folder? Please post your ideas or what you do if it is different.
Every file system has overhead such as setting Last Access, etc. These overhead procedures add time to copying files. Knowing which overhead procedures are ok to skip can be difficult at times. So, my first question is why is this an issue? An hour or two doesn't seem like a big deal unless you have to baby-sit the process or the process brings down users.
With that question asked, I have a few suggestions:
Suggestion 1: Zip First
Zip the files into a local zip file then copy the zip file and unzip if needed. This "trick" cuts the time down tremendously when copying large amounts of typical files.
Suggestion 2: Use a Better Tool
I don't know how good RoboCopy is. I've read it's about twice as fast as XCopy but I've had great success with FileBack PC to automate our backing up of files from one server to the next. Although I don't usually skip the overhead procedures, it does allow you to skip some of them, adjust buffers, schedule retries on failed files, etc. Here's a screen shot from their Advanced setup dialog:
Just to clearify what we are talking about, what is the database system? Since "copy time" is not an issue then I assume that reindexing tables is a time issue. Why are you reindexing the tables nightly? How exactly are you acomplishing the reindexing?
I agree with Wes, Chimney Sweep is a great product and if you are going to rebuild the tables you should look closely at it. However, if the indexes are maintained you shouldnt have to rebuild them nightly.
There is a table build interactive form supplied with paradox and the tUtil32.dll is also included.
First a disclaimer: I am no PDOX guru. I just work for one.
I have done a fair amount of Delphi coding using PDOX back ends, however.
One does have to wonder about the reindexing. In a properly configured enviornment, and driven by a robust application, the PDOX database is pretty darned reliable.
I'll throw out just a couple of suggestions that, perhaps taken together, will lead to a more satisfactory nightly procedure.
First, there's the old rule, "If it ain't broke, don't fix it." Why reindex all tables if none, one, or just a few are damaged? It would make more sense, to me, to validate each table, then "repair" only those that fail validation. I'd bet that 27 nights out of 30, the only necessary operation is the file copy.
No matter how validation is performed, I'd want a log of those tables that failed. Over time, a pattern will probably emerge that'll suggest places in the application(s) that may need attention.
I've heard several hard-core Paradox developers lauding Chimney Sweep. I don't know anything about it, but it might bear investigation. It may well be that it can:
Perform validations faster
Report tables failing validation
Perform table repairs faster than Borland/Corel tools.
For a nightly regimen, it may take some batch file programming and command line parameter tweaking, but it seems to me that the effort to get a selective repair, rather than a slow, shotgun approach, would be worth it.
Along with the DLL, Borland also provided an interacive utility program, written in Delphi, and which you can obtain by perusing the linked KB article at the top of this thread. That download's installer will also get you the TUtil32.DLL.
Now, because the above is an interactive program, it's not exactly suitable for an automated, nightly batch process.
Using the calls in TUtil32.DLL, we could create command-line programs for you that would do the trick for a "smart" nightly regimen.
Imagine a command-line program we'll call PdoxValidate that, when run, would validate every table in your database, and emit a simple text file with a list of tables that failed - and would append the same to a date-stamped log file.
Then imagine another command line program we'll call PdoxRebuild. When run, it would examine the short file of tables that failed validation, and rebuild only them, then delete the file so it's out of the way for the next night's run.
Your batch file, then, might look like this:
PdoxValidate
PdoxRebuild
XCopy....
But I hesitate to suggest such an effort before you've exhausted your exploration of Chimney Sweep. I'm not a big fan of reinventing the wheel.
Since my last post, I found a better article in our knowledge base, and linked it at the top of this thread. The Repairing Paradox Tablesarticle still might be useful.
Actually my problem really isnt the " time " with the file coping. Before my files are copied at the end of the night my paradox tables are all reindexed and the tables are large and it takes time to do this, after the reindex, the files are then copied over to a "lookups" location, SOMETIMES the tables may not get reindexed correctly or may have a size issue all kind of random problems sometimes happen, and after the file copy to the lookup folder ( this folder is the lookups the processors in the office use to work with ) the next day at work in the morning the processors cannot do lookups because some tables may be messed up, when this happens, we have them work from a day or so older back up while we reindex the tables again and make sure the tables are working, then x copy them over to the lookups folder, then switch the processors alias back to the " todaysreal" lookups for them to work.
In the morning when this happens and i have to wait on x copy to transfer the files it takes time and the processors cant see new information and just causes problems, i was just trying to think of some ways to speed up these processes...
This is a small example of what code i use, this code here just reindexes a few fields in the invoices.db, the real script i have has more tables and fields: ( i copied and pasted the code in here and the code looks "jumbled" here sorry ; / )
var t table q query timebefore, timeafter time tc tcursor fs filesystem tv tableview app application src Table dest String endvar
;message(+" "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount))
[;_--]----- INDEX TABLES ON ACB\ACB21 DIRECTORY tablecount=tablecount+1
t.attach("\\\\acb\\acb21lookups\\invoices.db") if t.lock("full")=true then indexcount=indexcount+1 message("CONTACTNUM of Invoices "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount)) sleep(100) t.reindex("CONTACTNUM") t.unlock("full") endif t.unattach()
indexcount=indexcount+1 message("CheckMoName of Invoices "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount)) t.reindex("CHECKMONAME") t.unlock("full")
if t.lock("full")=true then indexcount=indexcount+1 message("CHECKMONUM of Invoices "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount)) t.reindex("CHECKMONUM") t.unlock("full") endif t.unattach()
if t.lock("full")=true then indexcount=indexcount+1 message("CREDITCARDNUM of Invoices "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount)) t.reindex("CREDITCARDNUM") t.unlock("full") endif t.unattach()
if t.lock("full")=true then indexcount=indexcount+1 message("INVOICENUM of Invoices "+string(tablecount)+" "+string(indexcount)+" out of "+string(totalcount)) t.reindex("INVOICENUM") t.unlock("full") endif t.unattach()
Very true Wes, if it is't broken then you shouldnt fix it. You have a point. Would you mind sharing an example in code of what you mean by "to validate each table"?
GSCopy Pro v6.0 (RoboCopy Alternative) with Open File Agent
GSCopyPro is a single command-line tool (CLI) that can copy, replicate and move files from one folder to another. This folder can be on the same machine/ server or another server elsewhere. What makes GSCopyPro stand out from other competitors is the fact it works on 32-bit as well as 64-bit systems and has no restrictions. It can easily be scheduled to run as a scheduled task and fully automated. GSCopyPro also comes with an open file agent which can copy files that are locked/ opened by other processes. This feature is supported in all windows versions from widows XP/ 2003 and later.