LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2012, 05:59 PM   #1
Seventh
Member
 
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Rep: Reputation: 30
Stacking rsync commands


Hi folks,

Not sure if this belongs in the newbie or the server section, so my apologies if this is the wrong place.

I have a webserver that I backup using a handful of rsync scripts that I run under OSX. They're pretty basic, and just sync a few directories in various parts of the filesystem.

Right now, I have to run them separately, since (for example) one backs up something under /home/user/website/stuff_to_be_backedup, while another backs up something under /home/someotheruser/someotherstuff

Since the rsync script is authenticating to the server, is there a way to get it to backup multiple sections? Right now I just run four copies of the script and authenticate each time, but I assume there's probably a way (that my Google-fu fails to find) that I can have it log in, rsync the first bit, then the second, then so-on without having to log in/out each time.

Any insight would be great. Cheers!
 
Old 07-15-2012, 07:05 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
If you have an ssh authentication agent running in your login session, you can run ssh-add to add identities to the agent and they will be available to rsync without further authentication. ssh-agent is generally started automatically in a X session. If you're logging in from a text terminal, you'd probably need to run
Code:
eval $(ssh-agent -s)
to start the agent and set up the needed environment variables. You can see the manpages for ssh-agent and ssh-add for more details than you probably wanted to know.
 
Old 07-15-2012, 07:09 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You can also use key-based authentication, this way you don't have to give your password/username at all and can automate the backup with cron (or whatever MacOS X uses instead).
 
Old 07-28-2012, 09:35 AM   #4
Seventh
Member
 
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Original Poster
Rep: Reputation: 30
Thanks very much guys!

I was able to use this tutorial here:

https://blogs.oracle.com/jkini/entry/how_to_scp_scp_and

And it worked perfectly. Much appreciated!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need advice about redundant switches / LACP, stacking or ... pingu Linux - Networking 8 01-15-2012 03:20 PM
LXer: 3M, IBM collaborate on chip stacking LXer Syndicated Linux News 0 09-08-2011 01:30 AM
Help with Rsync and DU commands output to file and mail ssa2204 Linux - Newbie 1 04-29-2011 08:09 AM
rsync ssh - how to execute shell commands on server banjer Linux - Newbie 4 11-04-2009 02:01 PM
LXer: Geronimo stacking up against Web 2.0 concepts LXer Syndicated Linux News 0 01-27-2007 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration