TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


technote:netcat:linux_sync

This is an old revision of the document!


Executing Sync Using Netcat

Prerequisites

  • root or sudo privileges to install software and scripts.
  • Knowledge of using vi or similar to create and enable scripts
  • Netcat installed on your system, to check run the command ncat –version
  • tcp access to the server TapeTrack database and Sync is installed on
  • xinetd installed on the server TapeTrack database and Sync is installed on
  • Knowledge on how to extract the Volume data from your backup server (eg TSM, NetBackup)

Setting Up Sending Server

Create a script (eg run-remote-sync.sh) on your sending server, with executable permissions.

Add the required code to extract the Volume data to be Sync'd with your TapeTrack (receiving) Server into a text or CSV file.

vmquery -W -a > report.txt

Add the call Netcat, including the IP address and Port of the receiving server, along with the input data file. In the example the IP is XXX.XXX.XXX.XXX and Port 4545, these need to be replaced with your actual IP and Port numbers.

You can also record the output from the Sync if required by redirecting the stdin stream to file (eg Sync-output.txt).

nc XXX.XXX.XXX.XXX 4545 < ./report.txt > Sync-output.txt

Setting Up Receiving Server

Create an entry in the /etc/services file with the name of the service and port number and protocol. In this example we will use the service name receive-sync and the port 4545 to match the sending server details. These details can be modified to suit what name and port you require, as long as the sending and receiving ports match.

receive-sync   4545/tcp  

Create the xinetd service file (receive-sync) in /etc/xinetd.d with the minimum code

 service receive-sync
 {
      disable         = no
      socket_type     = stream
      protocol        = tcp
      port            = 4545
      wait            = no
      user            = root
      server          = /etc/tapetrack/scripts/netcat/runLocalSync.sh
      server_args     = -S user:-passwordt@localhost
      only_from       = YYY.YYY.YYY.YYY
      log_on_failure  +=USERID
 }
technote/netcat/linux_sync.1623729591.txt.gz · Last modified: 2025/01/21 22:07 (external edit)