LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-11-2015, 05:00 PM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
Can you rsync 2 source directories into 2 target directories?


Is there a way to have two sources and two targets in one line/rsync command? instead of running rsync -av /source1 /target1, waiting for that to finish, then running rsycn -av /source2 /target2. And i can only do this from the CLI, i can't just cron the two commands like i normally would.
 
Old 11-11-2015, 05:47 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'm pretty sure you can have multiple copies of rsync running at the same time - its just a program like any other.
You've said they won't be overlapping, so I can't see why it wouldn't work.
 
1 members found this post helpful.
Old 11-11-2015, 06:37 PM   #3
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Is there a way to have two sources and two targets in one line/rsync command?
No. But you can do it in one line.

Code:
rsync -av /source1 /target1 & rsync -av /source2 /target2
The & causes the first command to drop to background and start the second one. They will both run and complete at the same time.

If you want to be able to control both, use two terminals.
 
1 members found this post helpful.
Old 11-12-2015, 08:32 AM   #4
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Thanks Chris & Sefyir. I'll try it with the &, seems like that's what I was after based on your description. don't need to control them.
 
Old 01-14-2016, 11:50 AM   #5
RegLIN
LQ Newbie
 
Registered: Jan 2016
Location: midwest, st louis
Posts: 2

Rep: Reputation: Disabled
Smile Beginner trying to move one directory from one user to another user

so as the root I am typing

# mv /home /placy /confid_wh /home /bcassini

but I am receiving -bash error and mv target bcassini is not a directory? what am I doing wrong?

thanks,
RegLin
 
Old 01-14-2016, 12:21 PM   #6
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by RegLIN View Post
so as the root I am typing

# mv /home /placy /confid_wh /home /bcassini

but I am receiving -bash error and mv target bcassini is not a directory? what am I doing wrong?

thanks,
RegLin
What your command really says is this:

move directories /home /placy /confid_wh /home into directory /bassini

You probably have not created a directory located at /bassini, resulting in that error
 
Old 01-14-2016, 02:04 PM   #7
RegLIN
LQ Newbie
 
Registered: Jan 2016
Location: midwest, st louis
Posts: 2

Rep: Reputation: Disabled
to

Thanks Seyfir
but I do have a directory already as bcassini. I didn't make it, it was already there. But I will go back and check it. We signed in under another name automatically, so at he $ prompt, I had to move the directories from one to another, but first go to to root directory as another user and used their password to have permission to do it. but when I put this in, i keep getting errors. I have been working on it now for two days.

at the $prompt... I used su -l /bcassini
and then it asked for the password, I entered and then it took me to the root #.

I don't know if that made a difference.

smile,
REGLin
 
Old 01-21-2016, 10:43 AM   #8
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
working on directories is tricky sometimes, what are the permissions on that directory?
 
  


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
Merge directories with rsync xeon123 Linux - General 6 05-07-2015 07:38 AM
Should symbolic link target directories have foward slash? NotionCommotion Linux - Newbie 6 11-17-2014 12:34 PM
rsync not writing to existing directories sigint-ninja Linux - Newbie 10 06-10-2014 03:46 PM
rsync to check two directories...? resetreset Linux - Software 3 01-26-2011 03:53 AM
How can I use rsync to remove source directories? tdnnash25 Linux - Server 2 10-10-2009 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:43 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