technote:netcat:linux_sync
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
technote:netcat:linux_sync [2021/06/15 03:58] – [Setting Up Sending Server] Scott Cunliffe | technote: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 < ./ | nc XXX.XXX.XXX.XXX 4545 < ./ | ||
+ | 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 | receive-sync | ||
| | ||
- | Create the xinetd (receive-sync) | + | Create the xinetd |
| | ||
Line 41: | Line 41: | ||
wait = no | wait = no | ||
user = root | user = root | ||
- | server | + | server |
- | server_args | + | server_args |
only_from | only_from | ||
log_on_failure | log_on_failure | ||
} | } | ||
+ | For other options see the Linux xinetd manual pages. | ||
+ | |||
+ | Restart the xinetd service to refresh the data. | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | ===== Create Script To Execute When Port 4545 Request Is Received ===== | ||
+ | |||
+ | Create a script at ''/ | ||
+ | |||
+ | Add the code to execute the Sync, including the full path to the ttidef file | ||
+ | |||
+ | #!/bin/bash | ||
+ | cd / | ||
+ | | ||
+ | / | ||
+ | | ||
+ | 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: | ||
+ | * [[cookbook: | ||
+ | * [[cookbook: | ||
+ | * [[cookbook: | ||
+ | * [[cookbook: | ||
+ | * [[cookbook: | ||
+ | * [[cookbook: | ||
+ | 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)