LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-18-2010, 01:00 PM   #1
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Rep: Reputation: 0
Server to Server sync syntax


I am looking to update the data on new server from the old one. I am not that familiar with rsync as i am normally a windows admin. I used rsync 1 folder at a time from old ubuntu server to new ubuntu server. is there a method by which i can use rsync to sync data from multiple folders using ssh say over night? Also on my first datasync i had some permission errors when moving some files from users home directory. As root user how may i move these files? I am not trying to view the files just migrate them to new server.

James
 
Old 10-18-2010, 03:39 PM   #2
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
http://sites.google.com/site/rsync2u...w-rsync-works3

The key here is recursive -r and preserve permissions -p

Regards,
JKZfixme
 
Old 10-19-2010, 08:46 AM   #3
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Ok i tried it however i am still presented with a few files in the home directories(not all) that give me a permission denied error. There are not that many files giving me this issue. I am not sure what I am missing
This was a dry run test i did
rsync -ainp --exclude <filename> -e ssh <username>@<source server name>:/home /
I have intentionally substituted the names in brackets just in case you think I may be that green.
 
Old 10-20-2010, 09:02 AM   #4
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
1. are they the same files you had issues with before ?
2. does the <username>@<source server name> have rights to access files ? ie ls -l to verify
3. try running rsync in verbose and creating a log file ie rsync -v [other options] src dest >> rsynclog.txt

Regards,
JKZfixme
 
Old 10-20-2010, 09:55 AM   #5
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
These files are the same ones. I noticed a majority of the files where the .bash files in the users home directory and files related to that. Only one or two files where failing that were special documents. Unfortunatly i cannot post screenshots or any other useful information as this would be a violation of the contract im under. Are the users bash related files in the home directory all that critical? should i even be worried about those or forget it and move on?
 
Old 10-20-2010, 11:32 AM   #6
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
depends on what they are

.bash_profile or .bashrc are settings , you could set environment variables as well so I would look at them and make sure its not important.

I would stress checking the permissions again
 
Old 10-20-2010, 12:10 PM   #7
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
permissions on the files are _rw_rw__. The directories permission are missing write permissions for groups and others.
 
Old 10-21-2010, 10:11 AM   #8
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Today i tried changing permisions for read/write and execute across the board. That works but it still gives permission denied errors on rsyncing them.
 
Old 10-21-2010, 11:40 AM   #9
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Solved. I was not changing the permissions correctly. Once changed i was able to move them and change permissions back. This works although seems a sloppy inefficient way to do things. If anyone know of a simpler method i would love to hear it. Otherwise this is technically a solved thread.
 
Old 10-22-2010, 07:23 AM   #10
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
instead of <username>@<source server name> do <root>@<source server name> and make sure to do -p to preserve permissions, that should solve your permission issue.


Regards,
JKZfixme
 
Old 10-22-2010, 08:51 AM   #11
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks although that still leaves me with the same issue.I even tried locally as root and get same results. It allows permission changes but that is it. So i suppose i will have to change the permissions for the few offending files and change it back after move.

Thanks again for all your help, i have learned a lot about rsync as a result!
 
Old 10-28-2010, 09:47 AM   #12
James Moutoux
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I finally found a simple solution to the rsync problem. If you are an admin level user with sudo authority you need to pass your name as root and your password otherwise on the other end it does not seem to pass the su command with the ssh command
rsync -ainp --exclude <filename> -e ssh root@<source server name>:/home / <--- this line will copy all files as full root without the permission denied error.

thanks again for the help jkzfixme and i hope my solution helps others out there as well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
server to server sync jindalarpan Linux - Server 6 09-20-2009 05:13 AM
NTP server not sync sebash00 Linux - General 6 04-04-2008 01:40 AM
Sync windows 2000 server time with Linux server johnbeskie Linux - Enterprise 2 11-03-2007 04:25 AM
server side include syntax help nkoplm Programming 1 11-08-2005 09:53 AM
Timer Server Sync vofkid Linux - Newbie 1 03-19-2002 03:14 PM

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

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