As through one ssh connection to do some action?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
Want to put the cron script that will bekapit data via ssh. Backup the idea will consist of three actions:

1) Copy the previous backup to the new folder hardlinkname. Apparently so:
ssh user@server cp --link from/ to/

2) Upload a backup of the database. Apparently so:
scp database.tar.gz user@server:to/

3) Synchronize the new files using rsync

It is only obligatory and obvious actions. Of the non-obvious — you need to get a list of directories to find out where to copy in the first paragraph. Sometimes you will need to thin out old backups.

Question: each of these commands will install its own ssh connection. Maybe of course it's not that long compared to the time of the backup, but it's still not kosher. They can do it all through a single ssh connection?
by | 6 views

5 Answers

0 like 0 dislike
Maybe You should look at the key "-M" from ssh. This option allows you to use the already established connection with the remote host for new ssh sessions with the same host. A little more detail with a small example: www.linuxjournal.com/content/speed-multiple-ssh-connections-same-server
by
0 like 0 dislike
try to mount a remote FS using sshfs
by
0 like 0 dislike
I think what you want has already been invented and debugged, and called rsnapshot
by
0 like 0 dislike
Well, the first can be combined with the second, but to swing in two streams (database and rsync) will have to do two connexin.
\r
And get a list of directories and thinning of backups it is better to put the script on the other side. Even better in CZK.
by
0 like 0 dislike
Maybe Bacula?
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,029 users