This question already has an answer here:
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:
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.