Pergunta

I perform ssh to remote server to run a backup script. Then scp it to local machine.

1. ssh root@Remoteserverip sh ~/folder/backupscript.sh
2. scp root@Remoteserverip:/backupfolder/file.tgz /localfolder/

Is there any way to script these two operations in one script?


Ps: couldn't find solution elsewhere.

Foi útil?

Solução

Why not? Just put those commands in the script and thats it.

ssh root@Remoteserverip sh ~/folder/backupscript.sh
scp root@Remoteserverip:/backupfolder/file.tgz /localfolder/
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top