Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-18-2010, 01:00 PM
|
#1
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Rep:
|
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
|
|
|
10-19-2010, 08:46 AM
|
#3
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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. 
|
|
|
10-20-2010, 09:02 AM
|
#4
|
Member
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Rep:
|
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
|
|
|
10-20-2010, 09:55 AM
|
#5
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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?
|
|
|
10-20-2010, 11:32 AM
|
#6
|
Member
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Rep:
|
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
|
|
|
10-20-2010, 12:10 PM
|
#7
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
permissions on the files are _rw_rw__. The directories permission are missing write permissions for groups and others.
|
|
|
10-21-2010, 10:11 AM
|
#8
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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.
|
|
|
10-21-2010, 11:40 AM
|
#9
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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.
|
|
|
10-22-2010, 07:23 AM
|
#10
|
Member
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Rep:
|
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
|
|
|
10-22-2010, 08:51 AM
|
#11
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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!
|
|
|
10-28-2010, 09:47 AM
|
#12
|
LQ Newbie
Registered: Oct 2010
Posts: 8
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 11:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|