Article 4T027 Copy&delete script between servers

Copy&delete script between servers

by
hatfani
from LinuxQuestions.org on (#4T027)
Hey everyone,

I have 2 remote Servers running Linux centos: Server 1and Server 5.
On Server 1I have a directory named: 'Example'
I need to copy 'Example' directory from Server 1 to Server 5 and then delete 'Example' directory from Server 1 (if there's a possibility to do it by one command it would be better of course).
I would like to create a script for those actions, I saw that there are some options with scp/rsync commands.
I think that I need to set up ssh-key too so they'll do it automatically without the need of authentications all the time - would like to have more information about how do I do that.

Thank you!latest?d=yIl2AUoC8zA latest?i=49rHVYaDEVs:-2z8BBb1Tic:F7zBnMy latest?i=49rHVYaDEVs:-2z8BBb1Tic:V_sGLiP latest?d=qj6IDK7rITs latest?i=49rHVYaDEVs:-2z8BBb1Tic:gIN9vFw49rHVYaDEVs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments