muerwre.github.io/content/Linux/Rsync file with SSH.md
2022-11-04 18:29:11 +06:00

275 B

Downloads file from #SSH with rsync and puts it in current folder.

#!/bin/bash

PORT=22
USER=user
HOST=example.com
REMOTE_PATH=/tmp
REMOTE_FILE=sample.text
DEST_PATH=./

rsync -a -e "ssh -p $PORT" -P -v \
	"$USER@$HOST:$REMOTE_PATH/$REMOTE_FILE" \
	"$DEST_PATH"