Can I use rsync to move a list of files in different directories to a remote sever without logging in more than once?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
So, I'm trying to write a script to back up some various configuration files with my ssh fileserver, but I'm not sure the best way to go about this. It would be nice if I could just fill a file with absolute file paths for both machines and directly do this with parallel or something. Parallel has a script that works for an individual directory, but I want to expand this to multiple locations.
For example:
/home/localuser/.bashrc --> remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
/home/localuser/.config/i3/config --> remoteuser@remoteIP:/home/remoteuser/backup/.config/i3/config
for a multitude of files as well as going in the reverse direction if the server actually has a more recent copy.
remoteuser@remoteIP:/home/remoteuser/backup/.bashrc --> /home/localuser/.bashrc
I could effectively do this for one file using these two commands, but I'd have to log in twice.
rsync -vrut -e 'ssh -p portnumber' /home/localuser/.bashrc remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
rsync -vrut -e 'ssh -p portnumber' remoteuser@remoteIP:/home/remoteuser/backup/.bashrc /home/localuser/.bashrc
ssh rsync backup remote
add a comment |Â
up vote
0
down vote
favorite
So, I'm trying to write a script to back up some various configuration files with my ssh fileserver, but I'm not sure the best way to go about this. It would be nice if I could just fill a file with absolute file paths for both machines and directly do this with parallel or something. Parallel has a script that works for an individual directory, but I want to expand this to multiple locations.
For example:
/home/localuser/.bashrc --> remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
/home/localuser/.config/i3/config --> remoteuser@remoteIP:/home/remoteuser/backup/.config/i3/config
for a multitude of files as well as going in the reverse direction if the server actually has a more recent copy.
remoteuser@remoteIP:/home/remoteuser/backup/.bashrc --> /home/localuser/.bashrc
I could effectively do this for one file using these two commands, but I'd have to log in twice.
rsync -vrut -e 'ssh -p portnumber' /home/localuser/.bashrc remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
rsync -vrut -e 'ssh -p portnumber' remoteuser@remoteIP:/home/remoteuser/backup/.bashrc /home/localuser/.bashrc
ssh rsync backup remote
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So, I'm trying to write a script to back up some various configuration files with my ssh fileserver, but I'm not sure the best way to go about this. It would be nice if I could just fill a file with absolute file paths for both machines and directly do this with parallel or something. Parallel has a script that works for an individual directory, but I want to expand this to multiple locations.
For example:
/home/localuser/.bashrc --> remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
/home/localuser/.config/i3/config --> remoteuser@remoteIP:/home/remoteuser/backup/.config/i3/config
for a multitude of files as well as going in the reverse direction if the server actually has a more recent copy.
remoteuser@remoteIP:/home/remoteuser/backup/.bashrc --> /home/localuser/.bashrc
I could effectively do this for one file using these two commands, but I'd have to log in twice.
rsync -vrut -e 'ssh -p portnumber' /home/localuser/.bashrc remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
rsync -vrut -e 'ssh -p portnumber' remoteuser@remoteIP:/home/remoteuser/backup/.bashrc /home/localuser/.bashrc
ssh rsync backup remote
So, I'm trying to write a script to back up some various configuration files with my ssh fileserver, but I'm not sure the best way to go about this. It would be nice if I could just fill a file with absolute file paths for both machines and directly do this with parallel or something. Parallel has a script that works for an individual directory, but I want to expand this to multiple locations.
For example:
/home/localuser/.bashrc --> remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
/home/localuser/.config/i3/config --> remoteuser@remoteIP:/home/remoteuser/backup/.config/i3/config
for a multitude of files as well as going in the reverse direction if the server actually has a more recent copy.
remoteuser@remoteIP:/home/remoteuser/backup/.bashrc --> /home/localuser/.bashrc
I could effectively do this for one file using these two commands, but I'd have to log in twice.
rsync -vrut -e 'ssh -p portnumber' /home/localuser/.bashrc remoteuser@remoteIP:/home/remoteuser/backup/.bashrc
rsync -vrut -e 'ssh -p portnumber' remoteuser@remoteIP:/home/remoteuser/backup/.bashrc /home/localuser/.bashrc
ssh rsync backup remote
ssh rsync backup remote
asked 1 min ago
T. Zack Crawford
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475647%2fcan-i-use-rsync-to-move-a-list-of-files-in-different-directories-to-a-remote-sev%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password