LinuxQuestions.org
Help answer threads with 0 replies.
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 02-11-2010, 07:53 AM   #1
Jeroen1000
Member
 
Registered: Sep 2009
Posts: 44

Rep: Reputation: 15
Question Rsync a share on a Windows box


Hi everyone,

I've figured out about half of the problem this time. I've duplicated the directory structure of the Windows machine on the Linux server.

I then proceed with mounting the Windows share on the Linux server. I type the mount command while I'm in Folder1 on the Linux server:

Code:
 mount -t smbfs -o username=test,password=test  //192.168.1.3/Folder1/Subfolder Subfolder
So far so good. Now I need to rsync and the command for this is

Code:
rsync -va /path/to/src /path/to/dst
But what do I fill in here? I'm guessing path/to/dst is just plain Folder1 on the Linux box. Path/to/src refers to the share on the Windows machine but since I've mounted that share, is path to source = path to destination?
 
Old 02-11-2010, 10:52 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
I'll answer this with an example:

Code:
core:~# mount /dev/hdc1 /backup
core:~# mount -t smbfs //192.168.0.10/folder /Windows/Server1
core:~# rsync -avh /Windows/Server1 /backup
Also based on what you said, watch for recursion.
 
Old 02-11-2010, 08:10 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,381

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
Could do it the other way too. Run rsync from windows.
 
Old 02-12-2010, 11:57 AM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
The only problem with rsync for windows is there are some interaction bugs between it and ssh which can cause some flusterating condition to manifest in some cases. I did a lot of research on it at one point and was finally able to determine that the bugs exist because of the way piping is handled in windows and the developers of all the packages (cygwin, ssh port for windows, rsync) all have listed the bug as being with cygwin and a fix is unlikely.

Which is unfortunate. That being said, anything that DOESN'T use cygwin is likely unaffected by it, but its hard to find a ssh and rsync client that don't use it that are open source (and understandably so).
 
Old 02-15-2010, 01:08 AM   #5
Jeroen1000
Member
 
Registered: Sep 2009
Posts: 44

Original Poster
Rep: Reputation: 15
Thanks guys, Works like a charm. Now I need to keep an eye on it. I've read that Rsync sometimes has trouble identifying which files have changed. Perhaps it does not always correctly interpret Windows' archive bit.
 
  


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
permissions of files created by rsync from windows share txm123 Linux - Newbie 2 08-28-2009 04:25 PM
rsync windows share question reckless2k2 Linux - Server 3 06-13-2007 04:20 PM
Share Internet from Windows XP box?? general2000vn Linux - Networking 3 04-18-2005 06:58 PM
acces windows share from my linux box jb_jauvin Slackware 6 03-30-2005 08:00 PM
(Windows) Only one Linux box can mount a smb share Artimus General 1 07-21-2004 12:12 PM


All times are GMT -5. The time now is 03:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration