On Jun 3, 2004, at 1:38 AM, Darren Duncan wrote:

At 1:26 AM +0200 6/3/04, David Costa wrote:
I am in the process of writing a PEAR package to handle Sqlite backups (both local backups and remote backups) and I am looking for some suggestions.

Is the right way to proceed the db dump ? I assume that copying the db will result in a corrupted file if the db is used at the time of backup.

The aim would be to dump or duplicate a whole database for a local or remote backup with the relevant integrity checks.

You can do a file backup reliably, like this:

thanks for your reply, few more questions

1. Obtain a file system read lock on the SQLite database file.
this shouldn't be a problem but I will need to do it from php. How would you do it in console ?

2. Check if a corresponding rollback log exists.

how ? :D

If it does not, then the database should be internally consistant. If it does, then you need to copy that file too and keep it together with the SQLite database file as if they were one unit. Copy the database file, and the rollback file if it exists.
3. Release the file system lock.
4. Both the original and the copy will be in an identical and either correct or recoverable state.


Thanks in advance for the help

Regards
David Costa

-- Darren Duncan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to