Backing up firefox book marks to server

Hi Guys,

 I have written a script in powershell for win7 environment to back up desktop files, firefox book marks, chrome bookmarks, outlook signature etc.. everything is working except the firefox book mark part..  to back up the book marks in firefox there is a function which is ilke : 

function backupFirefoxBare($nameOfbackupDirectory) {
Display “Backing up Firefox Bookmarks File” “Cyan”
copyFiles (“$Global:localBackupRestoreLocation\AppData\Roaming\Mozilla\Firefox\Profiles\droq4wy9.default\places.sqlite”) ("$Global:remoteBackupRestorePath$nameOfbackupDirectory")

Display "Backing up Firefox Bookmarks folder 'bookmarkbackups'" "Cyan"
copyFiles ("$Global:localBackupRestoreLocation\AppData\Roaming\Mozilla\Firefox\Profiles\droq4wy9.default\bookmarkbackups\*") ("$Global:remoteBackupRestorePath\$nameOfbackupDirectory\bookmarkbackups\")

}

but it throwing an error saying:

ERROR: Failed to copy due to access issues: C:\Users\nemo\Appdata\Roaming\Mozilla\Firefox\Profiles\droq4wy9.default\places.sqlite

and

RROR: Failed to copy due to access issues: C:\Users\nemo\Appdata\Roaming\Mozilla\Firefox\Profiles\droq4wy9.default\bookmarkbackups*

Any one has any idea ?

thanks

Firefox probably puts a lock on those files while it is running to prevent modification by another process while it’s open. Your script should ensure firefox is not running when it does the backup.

Just ran the script closing the firefox … Unfortunately same errors… just to let you know guys the schipt running powershell as admin :

function Test-Admin {
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal( [Security.Principal.WindowsIdentity]::GetCurrent() )
if ($currentPrincipal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator )) {
return $true
} else {
return $false
}
}

Ok, you closed firefox, but did you confirm none of the firefox processes were still running.

(Locked or damaged places.sqlite - MozillaZine Knowledge Base)
If Firefox works normally when you first open it after starting up the computer but multiple symptoms arise after you close and later reopen Firefox, it’s likely that a Firefox process from a previous session did not close properly and the Places database (“places.sqlite” file) is locked. To work around the issue, close Firefox completely, end any Firefox processes (or reboot the computer), and restart Firefox.
If this is a recurring problem, see Firefox hangs - Hang at exit and check for problematic extensions. Note: Starting in Firefox 3.5, if you open Firefox and the Places database is locked you will see the message, The bookmarks and history system will not be functional because one of Firefox’s files is in use by another application. Some security software can cause this problem. [3]