TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


technote:netcat:linux_sync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
technote:netcat:linux_sync [2021/06/15 03:58] – [Setting Up Sending Server] Scott Cunliffetechnote:netcat:linux_sync [2025/01/21 22:07] (current) – external edit 127.0.0.1
Line 24: Line 24:
   nc XXX.XXX.XXX.XXX 4545 < ./report.txt > Sync-output.txt   nc XXX.XXX.XXX.XXX 4545 < ./report.txt > Sync-output.txt
  
 +By placing both the vmquery code with the netcat execution code in the same script, you can schedule the script to run using cron or similar to execute the data extraction and call to the Sync process on the receiving server.
 ===== Setting Up Receiving Server ===== ===== Setting Up Receiving Server =====
      
Line 31: Line 31:
   receive-sync   4545/tcp     receive-sync   4545/tcp  
      
-Create the xinetd (receive-sync) file in /etc/xinetd.d  with the minimum code+Create the xinetd service file (receive-sync) in /etc/xinetd.d  with the minimum code, with the optional inclusion of the ''only_from       = YYY.YYY.YYY.YYY'' Only use the ''only_from'' if your IP address (or range) remain static.
  
    service receive-sync    service receive-sync
Line 41: Line 41:
         wait            = no         wait            = no
         user            = root         user            = root
-        server          = /etc/tapetrack/scripts/netcat/runLocalSync.sh +        server          = /etc/tapetrack/scripts/runSync.sh 
-        server_args     = -S user:-passwordt@localhost+        server_args     = -S user:-password@localhost
         only_from       = YYY.YYY.YYY.YYY         only_from       = YYY.YYY.YYY.YYY
         log_on_failure  +=USERID         log_on_failure  +=USERID
    }    }
  
 +For other options see the Linux xinetd manual pages.
 +
 +Restart the xinetd service to refresh the data.
 +
 +   systemctl restart xinetd
 +   
 + 
 +===== Create Script To Execute When Port 4545 Request Is Received =====
 +
 +Create a script at ''/etc/tapetrack/scripts/runSync.sh'' (or a location of your choice as long as the location matches the server address in the xinetd service file) and give it executable permissions.
 +
 +Add the code to execute the Sync, including the full path to the ttidef file
 +
 +  #!/bin/bash
 +  cd /etc/tapetrack/scripts/
 +  
 +  /bin/TMSS10Sync -S user:-password@localhost -d netcat-sync.ttidef
 +  
 +  exit
 +
 +When the Sync program is executed by the sending server with a call to the port, the data file will be passed to the Sync program via the stdin stream.
 +
 +Ensure the ttidef file is either in the same directory, or at the location stated in the script so the Sync program has access.
  
 +Examples of ttidef files:
 +    * [[cookbook:backupexec|Backup Exec]]
 +    * [[cookbook:commvault|Commvault]]
 +    * [[cookbook:dataprotector|Data Protector]]
 +    * [[cookbook:netbackup|NetBackup]]
 +    * [[cookbook:networker|NetWorker]]
 +    * [[cookbook:tsm|Tivoli Storage Manager]]
 +    * [[cookbook:veeam|VEEAM]]
  
  
 +Output from the Sync process will be passed back to the sending server from the stderr stream to the stdin stream.
  
 +This can be altered to write the output to file on either computer by using the > and 2> redirection streams to text file if required.
  
 +{{tag> technote netcat linux sync xinetd}}
      
    
  
  
technote/netcat/linux_sync.1623729537.txt.gz · Last modified: 2025/01/21 22:07 (external edit)