Re: [bareos-users] VSS ERR=The process cannot access the file because it is being used by another process

2024-01-16 Thread Spadajspadaj
I used the relatively new available client. (23-pre-something, 
downloaded around 2 weeks ago). Yes, I should have written that explicitly.


On 16.01.2024 15:23, Bruno Friedmann (bruno-at-bareos) wrote:
Hello, all normally the issues that are described here, should have 
been already fixed, and should work without any trouble with bareos >= 23


The code fixing the problem has been submitted and merge a certain 
time ago with PR1452

https://github.com/bareos/bareos/pull/1452

Please refresh your installation, and of course report success and 
failures.


Le jeudi 11 janvier 2024 à 23:17:26 UTC+1, Spadajspadaj a écrit :

As I understand, this is the interesting excerpt from the debug trace.

win10test-fd (50): findlib/find.cc:169-0 Verify=
Accurate= BaseJob= flags=<724185736>
win10test-fd (50): findlib/find.cc:169-0 Verify=
Accurate= BaseJob= flags=<724185736>
win10test-fd (450): findlib/find.cc:175-0 F C:/Users/test/NTUSER.DAT
win10test-fd (500): compat/compat.cc:278-0 Enter
convert_unix_to_win32_path
win10test-fd (500): compat/compat.cc:322-0 path =
\\?\C:\Users\test\NTUSER.DAT
win10test-fd (500): compat/compat.cc:328-0 Leave
cvt_u_to_win32_path path=\\?\C:\Users\test\NTUSER.DAT
win10test-fd (500): compat/compat.cc:234-0 Win32ConvInitCache:
Setup of thread specific cache at address 1532b2b76d0
win10test-fd (500): compat/compat.cc:531-0 Enter make_wchar_win32_path
win10test-fd (500): compat/compat.cc:555-0 Leave
make_wchar_win32_path=\\?\C:\Users\test\NTUSER.DAT
win10test-fd (500): compat/compat.cc:1609-0 sizino=8 ino=0
filename=C:/Users/test/NTUSER.DAT
win10test-fd (300): findlib/find_one.cc:911-0 File :
C:/Users/test/NTUSER.DAT
win10test-fd (130): filed/backup.cc:535-0 FT_REG saving:
C:/Users/test/NTUSER.DAT
win10test-fd (130): filed/backup.cc:646-0 filed: sending
C:/Users/test/NTUSER.DAT to stored
win10test-fd (150): lib/crypto_openssl.cc:641-0 crypto_digest_new
jcr=1532b228410
win10test-fd (300): filed/backup.cc:1575-0 encode_and_send_attrs
fname=C:/Users/test/NTUSER.DAT
win10test-fd (500): compat/compat.cc:278-0 Enter
convert_unix_to_win32_path
win10test-fd (500): compat/compat.cc:322-0 path =
\\?\C:\Users\test\NTUSER.DAT
win10test-fd (500): compat/compat.cc:328-0 Leave
cvt_u_to_win32_path path=\\?\C:\Users\test\NTUSER.DAT
win10test-fd (300): filed/backup.cc:1594-0 File
C:/Users/test/NTUSER.DAT
attribs=A A IH/ B A A CAi FAAA A A BlnTaz BlnTaz BlnTaz A A L
attribsEx=CAi HaQkZzohoU HaQvQ8Q7yY HaQvQ8Q7yY A FAAA
win10test-fd (300): filed/backup.cc:1620-0 >stored: attrhdr 1 5
0win10test-fd (200): filed/backup.cc:1772-0 No strip for
C:/Users/test/NTUSER.DAT
win10test-fd (300): filed/backup.cc:1715-0 >stored: attr len=130:
1 3 C:/Users/test/NTUSER.DAT
win10test-fd (150): filed/backup.cc:737-0 type=3 do_read=1
win10test-fd (100): findlib/bfile.cc:710-0 bopen: fname
C:/Users/test/NTUSER.DAT, flags 0010, mode , rdev 8226
win10test-fd (50): findlib/bfile.cc:565-0 === NO plugin
win10test-fd (100): findlib/bfile.cc:664-0 Read
CreateFileW=\\?\C:\Users\test\NTUSER.DAT
win10test-fd (850): lib/message.cc:1216-0 Enter Jmsg type=8
win10test-fd (850): lib/message.cc:613-0 Enter DispatchMessage
type=8 msg=win10test-fd JobId 16959: Cannot open
"C:/Users/test/NTUSER.DAT": ERR=The process cannot access the file
because it is being used by another process.
.
win10test-fd (850): lib/message.cc:820-0 DIRECTOR for following
msg: win10test-fd JobId 16959:  Cannot open
"C:/Users/test/NTUSER.DAT": ERR=The process cannot access the file
because it is being used by another process.
.
win10test-fd (400): findlib/find_one.cc:493-0 FT_REG FI=1 linked=0
file=C:/Users/test/NTUSER.DAT

From what I understand from the description of the
make_wchar_win32_path() method in win32/compat/compat.cc - we
should leave the function with the filename properly converted to
VSS-based one. But apparently we're stuck with local name.

MK

On 11.01.2024 22:03, Spadajspadaj wrote:


The more I dig into it, the more it seems it is bareos after all.

Unfortunately, building Windows bareos-fd is no small feat so I
cannot directly debug it but.

I ran a procmon against bareos-fd.exe and it seems that while the
FD process does create a VSS snapshot... it doesn't read from it.
It reads the files straight from the main device. I did a small
test fileset consisting of just my user's registry file. And both
procmon's dump as well as bareos-fd own debug trace shows that
it's trying to read simply a c:\users\test\ntuser.dat instead of
properly going for
\\?\GLOBALROOT\Device\HardDiskVolumeShadowCopyXX\Users\test\ntuser.dat.
That would explain why the job even though it's supposed to use
VSS, fails on copying open files.


Re: [bareos-users] VSS ERR=The process cannot access the file because it is being used by another process

2024-01-16 Thread Bruno Friedmann (bruno-at-bareos)
Hello, all normally the issues that are described here, should have been 
already fixed, and should work without any trouble with bareos >= 23

The code fixing the problem has been submitted and merge a certain time ago 
with PR1452
https://github.com/bareos/bareos/pull/1452

Please refresh your installation, and of course report success and failures.

Le jeudi 11 janvier 2024 à 23:17:26 UTC+1, Spadajspadaj a écrit :

> As I understand, this is the interesting excerpt from the debug trace.
>
> win10test-fd (50): findlib/find.cc:169-0 Verify= Accurate= 
> BaseJob= flags=<724185736>
> win10test-fd (50): findlib/find.cc:169-0 Verify= Accurate= 
> BaseJob= flags=<724185736>
> win10test-fd (450): findlib/find.cc:175-0 F C:/Users/test/NTUSER.DAT
> win10test-fd (500): compat/compat.cc:278-0 Enter convert_unix_to_win32_path
> win10test-fd (500): compat/compat.cc:322-0 path = 
> \\?\C:\Users\test\NTUSER.DAT
> win10test-fd (500): compat/compat.cc:328-0 Leave cvt_u_to_win32_path 
> path=\\?\C:\Users\test\NTUSER.DAT
> win10test-fd (500): compat/compat.cc:234-0 Win32ConvInitCache: Setup of 
> thread specific cache at address 1532b2b76d0
> win10test-fd (500): compat/compat.cc:531-0 Enter make_wchar_win32_path
> win10test-fd (500): compat/compat.cc:555-0 Leave 
> make_wchar_win32_path=\\?\C:\Users\test\NTUSER.DAT
> win10test-fd (500): compat/compat.cc:1609-0 sizino=8 ino=0 
> filename=C:/Users/test/NTUSER.DAT
> win10test-fd (300): findlib/find_one.cc:911-0 File : 
> C:/Users/test/NTUSER.DAT
> win10test-fd (130): filed/backup.cc:535-0 FT_REG saving: 
> C:/Users/test/NTUSER.DAT
> win10test-fd (130): filed/backup.cc:646-0 filed: sending 
> C:/Users/test/NTUSER.DAT to stored
> win10test-fd (150): lib/crypto_openssl.cc:641-0 crypto_digest_new 
> jcr=1532b228410
> win10test-fd (300): filed/backup.cc:1575-0 encode_and_send_attrs 
> fname=C:/Users/test/NTUSER.DAT
> win10test-fd (500): compat/compat.cc:278-0 Enter convert_unix_to_win32_path
> win10test-fd (500): compat/compat.cc:322-0 path = 
> \\?\C:\Users\test\NTUSER.DAT
> win10test-fd (500): compat/compat.cc:328-0 Leave cvt_u_to_win32_path 
> path=\\?\C:\Users\test\NTUSER.DAT
> win10test-fd (300): filed/backup.cc:1594-0 File C:/Users/test/NTUSER.DAT
> attribs=A A IH/ B A A CAi FAAA A A BlnTaz BlnTaz BlnTaz A A L
> attribsEx=CAi HaQkZzohoU HaQvQ8Q7yY HaQvQ8Q7yY A FAAA
> win10test-fd (300): filed/backup.cc:1620-0 >stored: attrhdr 1 5 
> 0win10test-fd (200): filed/backup.cc:1772-0 No strip for 
> C:/Users/test/NTUSER.DAT
> win10test-fd (300): filed/backup.cc:1715-0 >stored: attr len=130: 1 3 
> C:/Users/test/NTUSER.DAT
> win10test-fd (150): filed/backup.cc:737-0 type=3 do_read=1
> win10test-fd (100): findlib/bfile.cc:710-0 bopen: fname 
> C:/Users/test/NTUSER.DAT, flags 0010, mode , rdev 8226
> win10test-fd (50): findlib/bfile.cc:565-0 === NO plugin
> win10test-fd (100): findlib/bfile.cc:664-0 Read 
> CreateFileW=\\?\C:\Users\test\NTUSER.DAT
> win10test-fd (850): lib/message.cc:1216-0 Enter Jmsg type=8
> win10test-fd (850): lib/message.cc:613-0 Enter DispatchMessage type=8 
> msg=win10test-fd JobId 16959:  Cannot open "C:/Users/test/NTUSER.DAT": 
> ERR=The process cannot access the file because it is being used by another 
> process.
> .
> win10test-fd (850): lib/message.cc:820-0 DIRECTOR for following msg: 
> win10test-fd JobId 16959:  Cannot open "C:/Users/test/NTUSER.DAT": 
> ERR=The process cannot access the file because it is being used by another 
> process.
> .
> win10test-fd (400): findlib/find_one.cc:493-0 FT_REG FI=1 linked=0 
> file=C:/Users/test/NTUSER.DAT
>
> From what I understand from the description of the make_wchar_win32_path() 
> method in win32/compat/compat.cc - we should leave the function with the 
> filename properly converted to VSS-based one. But apparently we're stuck 
> with local name.
>
> MK
> On 11.01.2024 22:03, Spadajspadaj wrote:
>
> The more I dig into it, the more it seems it is bareos after all.
>
> Unfortunately, building Windows bareos-fd is no small feat so I cannot 
> directly debug it but.
>
> I ran a procmon against bareos-fd.exe and it seems that while the FD 
> process does create a VSS snapshot... it doesn't read from it. It reads the 
> files straight from the main device. I did a small test fileset consisting 
> of just my user's registry file. And both procmon's dump as well as 
> bareos-fd own debug trace shows that it's trying to read simply a 
> c:\users\test\ntuser.dat instead of properly going for 
> \\?\GLOBALROOT\Device\HardDiskVolumeShadowCopyXX\Users\test\ntuser.dat. 
> That would explain why the job even though it's supposed to use VSS, fails 
> on copying open files.
>
> When I created a very small example VS project just creating a VSS 
> snapshot and copying said file out of the VSS snapshot (using the proper 
> shadow copy volume path), it works OK.
>
> MK
> On 9.01.2024 15:11, spadaj...@gmail.com wrote:
>
> OK. There is more to this than just bareos.
> 1. I used the script from this thread and it 

[bareos-users] replicating bareos database and environment

2024-01-16 Thread Markus Dubois
Hi,

i was thinking about a solution to replicate a remote running bareos 
environment to the local site.
Cause was to restore faster, as browsing the remote director and database 
is slow.

So i've setup a postgres hot standby stream replica, a bareos director, a 
web gui on the local site

but i failed as soon as i tried to connect the bconsole on the local site 
console of the (replicated) bareos-director.

i got:
Connecting to Director 127.0.0.1:9101
Failed to connect to Director. Giving up.

the bareos-director seems to run though

PID TTY  STAT   TIME COMMAND
  1 ?Ss 0:00 /usr/sbin/bareos-dir -u bareos -f
 47 pts/0Ss+0:00 bash
 57 pts/1Ss 0:00 bash
 67 pts/1R+ 0:00 ps -ax

Is this use case not possible or how could this be achieved?


-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/c4046b78-0c1e-4f32-9866-c2656e0c53dan%40googlegroups.com.


Re: [bareos-users] Always Incremental Backups: Recycling and Disk Space

2024-01-16 Thread Philipp Storz

Am 15.01.24 um 16:16 schrieb Ralf Schulze:

Hello folks,

I'm using Bareos Always Incremental Scheme with the settings:

Job {
   ...
   Pool = "aincr30d"
   FullBackupPool = "aicons30d"
   Accurate = Yes
   AlwaysIncremental = Yes
   AlwaysIncrementalJobRetention = 1 months
}

Pool {
   Name = "aicons30d"
   LabelFormat = "aicons30d-"
   MaximumVolumeJobs = 1
   MaximumVolumeBytes = 50 g
   VolumeRetention = 1 months 1 weeks 3 days
   VolumeUseDuration = 23 hours
   Storage = "File"
   AutoPrune = No
   Recycle = No
}

After the 1 months daily incremental backups the daily consolitation started. Each day a Virtual 
Full backup job was created.

But the Virtual Full is each day a Full size backup, so the disk space is 
getting lower and lower.


This is exactly what is expected.
Please read the documentation describing it and how the "max full age" can 
solve the problem:

https://docs.bareos.org/TasksAndConcepts/AlwaysIncrementalBackupScheme.html#enhancements-for-the-always-incremental-backup-scheme

You also need to make sure that you use a new volume every day ("volume use duration"), so that jobs 
being removed from the database also will lead to media being recycled.


Will the option "Always Incremental Max Full Age" (for example with the setting '1 months 1 day') 
solve this problem? Only a virtual full backup after the specified time period? And will the initial 
full backup also be released for deletion?


Thanks Ralf

--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 
bareos-users+unsubscr...@googlegroups.com .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/c015711b-87c8-4d13-953e-40ea7751ddc0n%40googlegroups.com .


--
Mit freundlichen Grüßen

 Philipp Storz philipp.st...@bareos.com
 Bareos GmbH & Co. KG  Phone: +49 221 63 06 93-92
 http://www.bareos.com Fax:   +49 221 63 06 93-10

 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
 Geschäftsführer: Stephan Dühr, J. Steffens, P. Storz

--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/f016f90a-e24f-4c24-b28d-d823a29da7ea%40bareos.com.