Backups while files are open?  
Author Message
Aleniko29139





PostPosted: Visual FoxPro General, Backups while files are open? Top

Hi all;

Anyone does backups while users are logged in and fies are open

I would like to implement such backup procedure and I was wondering if anyone had experience with such thing.

Is this something I need to implement from within VFP using 'copy to' or sql commands or is there a utility that does this

Of course I need to 'lock' the users while the backup is being done, so no data entry is performed during backup...

Thanks.


Visual FoxPro2  
 
 
Alex Feldstein





PostPosted: Visual FoxPro General, Backups while files are open? Top

Backups are normally done off-hours with everybody out. If you have DBFs and somebody has a lock Windows backup utilities will fail (assuming you use a backkup to tape utility of some kind).

Backing up using COPY TO is not the best option and it is slower. It will have the same problem if somebody has a record lock. It is much easier to automate backup with an external utility and a scheduler.

If your data is in SQL Server insteasd of DBF then you have no problems as SQL Server can backup with users in the system.


 
 
Lakshminarayana





PostPosted: Visual FoxPro General, Backups while files are open? Top

u can try the following

get the list of dbfs and put it into array (dir *.dbf > x.txt. read x.txt into an array)

for i 1 to alen(array)

use flock command to lock the files one by one

then use file one by one and use copy to another file name

i.e.

public lok

lok = .t.

lok = flock('customer.dbf')

if lok

use customer in 0 again alias customer

copy to custbak.dbf

and do the above for all files