3

Is it possible to transfer files (client-server) from inside a ssh session?.

I know how to transfer files using SCP, This question is about transference from inside a ssh session. For example I start the ssh session:

ssh root@example.com

I perform some operations

echo "Test" > FILE

I transfer the files (pseudocode)

remotecp FILE client_directory

I want to know this because I want to make an automation script from some process (mostly backup operations) and I want to make it the most atomic way possible.

S182
  • 387

1 Answers1

1

If you are running your client with a external IP address:

IP=$(who mom hates | awk '{print $5}' | tr -d ')' |tr -d '(')
scp FILE USER@${IP}:~/some/path
RSFalcon7
  • 4,407