Rsync to backup directory

Hey Experts,

I have a development directory on my FreeBSD box. I use Samba to connect to this tree with my Windows XP Pro PC. I would like to setup and cron job rsync to backup any changed files on the Unix development directory to my Windows XP PC nightly. Is there a way I could have it increment changed files?

For example, if header.png was changed, backup the old header.png on my Windows XP box to "(date)_header.png" or something to tell it apart?

I will extend this into two 500 point questions if needed (one for Rsync and one for the increment naming).

Who is Participating?
it_alchemistConnect With a Mentor Commented:
I'd recommend following this tutorial:

which covers good ground and should help you get setup on your windows machine.  In terms of incrementing, again I'll refer you to a thorough tutorial instead of repeating the same info here. I found the information on this site to be very helpful as it explains in detail why things work and includes a very useful script which will work fine with BSD as well.

If you have any problems, please post here and we can help you debug.

drakkarnoirAuthor Commented:
Ok I installed rsync like that guide said on my Windows machine, but I can't find a port for it in FreeBSD?
drakkarnoirAuthor Commented:
Found it under net, continuing...
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

drakkarnoirAuthor Commented:
Ok so I got rsync setup on both boxes, and then this on my Windows box:

C:\Documents and Settings\Admin>c:\Cygwin\bin\rsync -vrtz --password-file=c:\cygwin\secret --delete /cygdrive/D/Data Me:
rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.3/pipe.c(83)
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.3/io.c(359)

D:/Data exists
David PiniellaConnect With a Mentor Commented:
is ssh installed in your windows/cygwin machine?
drakkarnoirAuthor Commented:
No, how do I install it?
drakkarnoirAuthor Commented:
Ok got ssh installed and running, now it says:

ssh: User: no address associated with name
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.3/io.c(515)

With the same command as above.
David PiniellaCommented:
make sure you're using the same username on both systems
drakkarnoirAuthor Commented:
Yeah, User is my Windows username and I have a user called User on my bsd box too...
drakkarnoirAuthor Commented:
Ok, this is where it stands now, and I am stuck:

I am able to do -

C:\Documents and Settings\Admin>c:\Cygwin\bin\rsync -vrtz --password-file=c:\cygw
in\secret --delete /cygdrive/D/Data
building file list ... done

sent 64 bytes  received 20 bytes  33.60 bytes/sec
total size is 11  speedup is 0.13

So if I create test.txt, it will be copied over into the directory I specifed for [User] in rsync.conf. Excellent!

Now, I tried a varied command on my *nix box (since my whole goal was to backup the *nix directory into a Windows folder):

rsync -vrtz --password-file=/usr/local/etc/rsyncd.secrets --delete /home/rsync_test/
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(365)

I went into cygwin and did rsync --daemon but stiill got the same error. Any ideas?
You need to configure sshd on your windows box to allow connection from your bsd box. You do this by editing sshd_config in your cygwin environment and making sure that the ListenAddress is set to and that the file locations are set properly.

Here are a few cygwin+openssh tutorials to look at:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.