Koozali.org: home of the SME Server

Transferring Info via Rsync

finchwizard

Transferring Info via Rsync
« on: May 30, 2006, 07:48:15 AM »
I am wanting to copy data from an old server, to a new server.

Old server A has 500 users.

New server B has 300 users.

All the users on the new server would like to have their data copied over from server A.

I have already imported all the users on the new server via Lat-tools.

I was going to use rsync to copy the data across from /home/e-smith/files/users/ to the new server.

But when I execute the command, I get all the data from /home/e-smith/files/users/ which includes users data that aren't on the new system.

What is the command to tell rsync to just update the folders that are already there, rather than copying ALL the data across.

And which server would I execute the command on.

Cheers.
James

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Transferring Info via Rsync
« Reply #1 on: May 31, 2006, 01:21:49 AM »
finchwizard

man rsync
...

finchwizard

Transferring Info via Rsync
« Reply #2 on: May 31, 2006, 01:26:54 AM »
Gee thanks, I never would of thought of that. </sarcastic>

Seriously, I've read the man page for the last 2 days.

I don't ask questions unless I've really explored and tried myself.

I got it anyway, rsync doesn't quite do what I needed it to do, had to create a script.

Offline raem

  • *
  • 3,972
  • +4/-0
Transferring Info via Rsync
« Reply #3 on: May 31, 2006, 01:53:04 AM »
finchwizard

>.... I've read the man page for the last 2 days....

Well if you told us that in your first post I would not have wasted my time.
...

finchwizard

Transferring Info via Rsync
« Reply #4 on: May 31, 2006, 02:02:40 AM »
I did say every time I tried.

It's all good now at least.

Code: [Select]

ls | while read dirname ; do
rsync -avz --filter='exclude .recycle' -e ssh IP_OF_OLD_SERVER:/home/e-smith/files/users/$dirname/ /home/e-smith/files/users/$dirname/
done


Just add your SSH keys so they don't ask for a password and your good.

Save that script file in /home/e-smith/files/users/ on the new server.

Just incase anyone else needs to do the same thing.