FbBackup error when doing backup to share

801 views
Skip to first unread message

Roland Turcan

unread,
Jul 8, 2020, 9:59:22 AM7/8/20
to firebird-net-provider
Hello all,

When doing backups to mapped drive or over UNC name exception is raised:

cannot open backup file \\nas_slavkov\home\ExeBackupTest\20200708-154258.fbk
No message for error code 336330835 found.

but gbak with the same permissions has no problem to create backup. When local drives are used then everything works fine.

My code:

FbBackupFile file = new FbBackupFile(settings.Directory + Path.DirectorySeparatorChar + settings.FileNamePrefix + ".fbk");
FbBackup backup = new FbBackup(settings.Backup.Connection.BuildConnectionString()); 
backup.BackupFiles.Add(file);
backup.Options = FbBackupFlags.NoGarbageCollect;
backup.Verbose = true;
backup.ServiceOutput += BackupServiceOutput;
backup.Execute();

I am using Firebird 3.0.5 on Windows 10 and .NET provider 7.5.0.

What can it be a problem?

Thanks in advance.

RT


Mark Rotteveel

unread,
Jul 8, 2020, 10:06:37 AM7/8/20
to firebird-n...@googlegroups.com
You're doing the backup through the Firebird server. When doing the
backup through the Firebird server, it is the rights of the Firebird
server process that determine what you can or cannot do. Assuming you
are running Firebird as a service, it likely runs as the local system
account, which - as far as I know - doesn't have access to UNC paths in
general (or otherwise, likely not to this specific path).

When using gbak, it is the gbak process itself that makes the backup,
using the OS access rights of the user that started gbak.

Mark
--
Mark Rotteveel

Jiří Činčura

unread,
Jul 8, 2020, 10:37:13 AM7/8/20
to 'Mr. John' via firebird-net-provider
FbStreamingBackup might be solution for you.

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

Roland Turcan

unread,
Jul 9, 2020, 2:08:14 AM7/9/20
to firebird-net-provider
Thanks Mark, you are right. When I start FB as user with permissions then it work like a charm.

I thougth that provider does the backup like gbak, but I was wrong.

Roland Turcan

unread,
Jul 9, 2020, 2:08:46 AM7/9/20
to firebird-net-provider
Thanks for tip, I will try.
Reply all
Reply to author
Forward
0 new messages