Answer the question
In order to leave comments, you need to log in
Silent ssh login and wait for startup?
I received the need to create backups every week, figured out the algorithm of actions, I would like to automate. The servers are located in the Scalaxy cloud, there is a backup server with a large partition where backups from the servers are poured. I copy the entire root image of the partition with the dd command and redirect everything via ssh to the backup server. During the main time, to save money, the server is turned off, it turns on on demand when you need to make a backup. The algorithm turned out like this:
Answer the question
In order to leave comments, you need to log in
No password: keys (ssh-keygen)
Backups: rsync (it's very fast, it doesn't copy everything, only differences)
Server off: ping (no?)
About the keys.
Connect with a command like:
while :; do ssh blablabla -o ConnectTimeout=10 && exit 0 || sleep 10; done
And why manually start copying?
1. Copy the key of any user included in the disk group (at least for me on gentoo so), well, or root'a, to the instance for backups. Example .
2. We add to the download a script that directly performs copying. If I were you, I would listen to colonel and use rsync. At the end of the script, I would put the poweroff command. Everything, the script worked, the instance turned off.
As an option, to check the server startup, you can set the key "ssh -o ConnectTimeout=10" (seconds).
And try to reconnect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question