You can test your config by using the command

bareos-dir -t -d100


here a script to run tests before starting the services:
---------8<---------------------
#!/bin/bash
# Purpose: Test config and restart bareos services.
#   Interrupt in case of running services.
# Script created: 2019 /bdu
# Last update: 13.06.2020 /bdu
###################################################
echo
printf "%*s" $(tput cols) |tr " " "=\n"
echo "==> Testing bareos-sd..."
/usr/sbin/bareos-sd -t
echo Done.
echo
printf "%*s" $(tput cols) |tr " " "=\n"
echo "==> Testing bareos-fd..."
/usr/sbin/bareos-fd -t
echo Done.
echo
printf "%*s" $(tput cols) |tr " " "=\n"
echo "== > Testing bareos-dir..."
/usr/sbin/bareos-dir -t
echo Done.
printf "%*s" $(tput cols) |tr " " "=\n"
echo

echo
echo "Restart all services now? (sleeping some seconds, so you might interrupt)"
for ((k = 0; k <= 10 ; k++))
do
    echo -n "[ "
    for ((i = 0 ; i <= k; i++)); do echo -n "###"; done
    for ((j = i ; j <= 10 ; j++)); do echo -n "   "; done
    v=$((k * 10))
    echo -n " ] "
    echo -n "$v %" $'\r'
    sleep 1
done
echo

# Check if there are actually jobs running. Exit the script if there is at least one running job: RJOBS=echo echo list jobs | bconsole | awk '{print $19}' |grep R |awk '{print $1}' > run-bj
RJOBS=`cat run-bj`
if [[ $RJOBS != "" ]]; then
   echo
echo "!!!! THERE ARE ACTUALLY SOME BACKUP JOBS RUNNING. Script canceled. Please restart later !!!" && exit 1;
   echo
else echo "No running jobs found, continuing..."
fi
rm run-bj
echo

echo Restarting bareos services...
/bin/systemctl restart bareos-dir bareos-sd bareos-fd
echo Done.

---------8<----------------

regards,
Birgit

On 23/12/20 18:14, 'Frank Cherry' via bareos-users wrote:
Thanks, have insert it into my configs and start a test but this was terminated by an error. Here is the lof of the job:


2020-12-23 16:32:25
storage1-fd JobId 9: Fatal error: lib/bsock_tcp.cc:131 Unable to connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt

2020-12-23 16:32:25
storage1-fd JobId 9: Fatal error: Failed to connect to Storage daemon: 127.0.0.1:9103

2020-12-23 16:32:25
bareos-dir JobId 9: Fatal error: Bad response to Storage command: wanted 2000 OK storage
, got 2902 Bad storage


2020-12-23 16:32:25
bareos-dir JobId 9: Error: Bareos bareos-dir 19.2.7 (16Apr20):
Build OS: Linux-3.10.0-1062.18.1.el7.x86_64 redhat Red Hat Enterprise Linux release 8.1 (Ootpa)
JobId: 9
Job: BackupStorage1.2020-12-23_16.02.22_04
Backup Level: Full
Client: "Storage1" 19.2.7 (16Apr20) Linux-3.10.0-1062.18.1.el7.x86_64,redhat,CentOS release 6.10 (Final)
FileSet: "Storage1Data" 2020-12-23 14:53:23
Pool: "Full" (From command line)
Catalog: "MyCatalog" (From Client resource)
Storage: "Tape" (From Job resource)
Scheduled time: 23-Dec-2020 16:02:22
Start time: 23-Dec-2020 16:02:24
End time: 23-Dec-2020 16:32:25
Elapsed time: 30 mins 1 sec
Priority: 10
FD Files Written: 0
SD Files Written: 0
FD Bytes Written: 0 (0 B)
SD Bytes Written: 0 (0 B)
Rate: 0.0 KB/s
Software Compression: None
VSS: no
Encryption: no
Accurate: no
Volume name(s):
Volume Session Id: 1
Volume Session Time: 1608735731
Last Volume Bytes: 0 (0 B)
Non-fatal FD errors: 2
SD Errors: 0
FD termination status: Fatal Error
SD termination status: Waiting on FD
Bareos binary info: bareos.org build: Get official binaries and vendor support on bareos.com
Termination: *** Backup Error ***


2020-12-23 16:28:25
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:23:15
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:18:05
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:12:55
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:07:45
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:02:35
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ...

2020-12-23 16:02:24
bareos-dir JobId 9: Start Backup JobId 9, Job=BackupStorage1.2020-12-23_16.02.22_04

2020-12-23 16:02:24
bareos-dir JobId 9: Connected Storage daemon at 127.0.0.1:9103, encryption: TLS_CHACHA20_POLY1305_SHA256

2020-12-23 16:02:24
bareos-dir JobId 9: Using Device "LTO7-Tape-Drive" to write.

2020-12-23 16:02:24
bareos-dir JobId 9: Probing client protocol... (result will be saved until config reload)

2020-12-23 16:02:24
bareos-dir JobId 9: Connected Client: Storage1 at 192.168.130.170:9102, encryption: PSK-AES256-CBC-SHA

2020-12-23 16:02:24
bareos-dir JobId 9: Handshake: Immediate TLS
2020-12-23 16:02:24
bareos-dir JobId 9: Encryption: PSK-AES256-CBC-SHA

------------------------------------------------------------------------------

Explanation: Client is Storage1 => 192.168.130.170 only FD is running there:
# ps ax | grep bareos
32321 ?        Ssl    0:00 /usr/sbin/bareos-fd -g bareos

# netstat -tulpn | grep bareos
tcp        0      0 0.0.0.0:9102 0.0.0.0:*                   LISTEN      32321/bareos-fd

From this client, I can connect to the Backup-Server 192.168.130.211 with DIR and SD running on it:

# telnet 192.168.130.211 9101
Trying 192.168.130.211...
Connected to 192.168.130.211.
Escape character is '^]'.
x
▒Connection closed by foreign host.

]# telnet 192.168.130.211 9103
Trying 192.168.130.211...
Connected to 192.168.130.211.
Escape character is '^]'.
x
▒Connection closed by foreign host.

During the backup, I have read this status infos:

Client Details:
Connecting to Client Storage1 at 192.168.130.170:9102
  Handshake: Immediate TLS, Encryption: PSK-AES256-CBC-SHA

storage1-fd Version: 19.2.7 (16 April 2020) Linux-3.10.0-1062.18.1.el7.x86_64 redhat CentOS release 6.10 (Final) Daemon started 23-Dez-20 15:46. Jobs: run=0 running=0, bareos.org build binary
  Sizeof: boffset_t=8 size_t=8 debug=0 trace=0 bwlimit=0kB/s

Running Jobs:
JobId 9 Job BackupStorage1.2020-12-23_16.02.22_04 is running.
     Full System or Console Job started: 23-Dez-20 16:02
     Files=0 Bytes=0 Bytes/sec=0 Errors=0
     Bwlimit=0
     Files Examined=0
     SDSocket closed.
bareos-dir (director) connected at: 23-Dez-20 16:19

Director:
Running Jobs:
Console connected at 23-Dec-20 16:19
  JobId Level   Name                       Status
======================================================================
     9 Full    BackupStorage1.2020-12-23_16.02.22_04 is waiting for Client Storage1 to connect to Storage Tape
====

Storage:
Storage:

Running Jobs:
Backup Job BackupStorage1.2020-12-23_16.02.22_04 waiting for Client connection.
Writing: Full Backup job BackupStorage1 JobId=9 Volume="Full-0003"
     pool="Full" device="LTO7-Tape-Drive" (/dev/tape)
     spooling=0 despooling=0 despool_wait=0
     Files=0 Bytes=0 AveBytes/sec=0 LastBytes/sec=0
     FDSocket closed

My SD device conf:
Device {
Name = LTO7-Tape-Drive
Drive Index = 0
Media Type = LTO-7
Archive Device = /dev/tape
LabelMedia = yes;
AutomaticMount = yes;
RemovableMedia = yes;
AlwaysOpen = no;
RandomAccess = no;
Spool Directory = /backup_spool/spool
Maximum Concurrent Jobs = 1
MaximumFileSize = 20GB
}

I can access the tape without any problems from CLI:
# mt -f /dev/tape status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (no translation).
Soft error count since last status=0
General status bits on (41010000):
  BOT ONLINE IM_REP_EN

--------------------------------------------------------
Why did the log says first:
Connected Storage daemon at 127.0.0.1:9103, encryption: TLS_CHACHA20_POLY1305_SHA256
and then later:
storage1-fd JobId 9: Warning: lib/bsock_tcp.cc:125 Could not connect to Storage daemon on 127.0.0.1:9103. ERR=Verbindungsaufbau abgelehnt
Retrying ..

As I do understand right, the fd on the client "storage1"is trying to connect to the storage daemon on 127.0.0.1 from it's point of view itself?
But there is no SD, this should be on 192.168.130.211


--
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 [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/32319ed3-4414-49e7-8238-17a6cca56406n%40googlegroups.com <https://groups.google.com/d/msgid/bareos-users/32319ed3-4414-49e7-8238-17a6cca56406n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/9f74c6f8-77f2-50dc-f93e-49d9623db15a%40unifr.ch.
  • [bareos-users]... 'Frank Cherry' via bareos-users
    • Re: [bare... 'Jon SCHEWE' via bareos-users
      • Re: [... 'DUCARROZ Birgit' via bareos-users
      • Re: [... laurence
        • R... 'Frank Cherry' via bareos-users
          • ... 'Jon SCHEWE' via bareos-users
            • ... 'Frank Kirschner | Celebrate Records GmbH' via bareos-users
          • ... 'DUCARROZ Birgit' via bareos-users

Reply via email to