removed dependency on known_hosts file

This commit is contained in:
2025-01-20 19:09:54 -05:00
parent 9586af2566
commit 421d5310ec
10 changed files with 56 additions and 19 deletions
+21
View File
@@ -0,0 +1,21 @@
FROM python:3.12-slim
ARG FROM_DIR=docker_dev/test/rsync_test
COPY ${FROM_DIR}/test.sh /test.sh
RUN apt-get update && apt-get install -y rsync openssh-client
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub
# Shared Volumes
RUN chmod +x /test.sh
WORKDIR /
SHELL ["/bin/bash", "-c"]
ENV PYTHONPATH=/
ENTRYPOINT [ "/test.sh" ]
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
date > /testfile.txt
Source=/testfile.txt
Targets=
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/tmp/"
Targets="${Targets} cvtt@hs01.cvtt.vpn:/tmp/"
for tgt in ${Targets}
do
Cmd="/usr/bin/rsync -ahv"
Cmd+=" -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"
Cmd+=" ${Source} ${tgt}"
echo $Cmd
eval $Cmd
done