Kind of lost on this.

8 posts / 0 new
Last post
Blackrose
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Kind of lost on this.

So Ive been looking into taking a windows 2k machine and backing up my documents to a debian box over ssh. I am using putty as my ssh client and have tried many different ways to connect and get it to backup my files. Could someone possibly show me an example and what the examples mean so that I may write a proper script for this. This is what I have come up with. Ive tried this:
@ECHO OFF
SET SECHAW_IDENTITY="C:\Program Files\cwRsync\doc\ssh-keygen.html"
SET SECHAW_TYPE=ssh
SET SECHAW_LOCALPORT=9119
SET SECHAW_SERVER=68.116.46.17
SET SECHAW_SERVERPORT=873
SET SECHAW_USER=SvcwRsync
SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" rsync -r /cygdrive/c/MyDocuments/ 68.116.46.17:/home/blackrose/Backup/
SET SECHAW_TUNNEL=ssh -i "C:\Program Files\cwRsync\doc\ssh-keygen.html" -L 9119:127.0.0.1:873 SvcwRsync@68.116.46.17 -T -N
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose

Also ive tried this:

@ cls
@ echo off
pause
rem Rsync job control file
C:\Cygwin\bin\rsync -vrtz --password-file=C:\Documents and Settings\Administrator\My Documents Blackrose@68.116.46.17::My Documents"/cygdrive/c/WINDOWS/My Documents/"
C:\Cygwin\bin\rsync -vrtz --password-file=C:\Documents and Settings\Administrator\My Documents Blackrose@68.116.46.17::My Documents "/cygdrive/c/Documents and Settings/administrator/My Documents/"

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

There will be a batch file example available from cwRsync start menu. Make a copy of it and add the following line at the end:

 rsync.exe -r /cygdrive/c/MyDocuments/ 68.116.46.17:/home/blackrose/Backup/

I assume that you have same login id at both sides.

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Kind of lost on this.

well I can login to the debian box remotely, but windows is not setup to do that.

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

When I enter the password it does not let me in?? It asks for the password I type it but it keeps asking then closes out after like the 5th try.

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

I am now getting this error
rsync: link_stat "/cygdrive/c/MyDocuments/."
failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at main.c(791)

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

Which directory do you have ? c:\MyDocuments  (/cygdrive/c/MyDocuments) or c:\My Documents ("/cygdrive/c/My Documents") ?

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

So the directory on my computer is C:\Documents and Settings\Administrator\My Documents
and the debian /home/blackrose/backup

this is what the file looks like.

@ECHO OFF
REM *****************************************************************
REM
REM CWRSYNC.CMD - Batch file template to start your rsync command (s).
REM
REM By Tevfik K. (http://itefix.no)
REM *****************************************************************

REM ** CUSTOMIZE ** Specify where to find rsync and related files (C:\CWRSYNC)
SET CWRSYNCHOME=C:\PROGRAM FILES\CWRSYNC

REM Set CYGWIN variable to 'nontsec'. That makes sure that permissions
REM on your windows machine are not updated as a side effect of cygwin
REM operations.
SET CYGWIN=nontsec

REM Set HOME variable to your windows home directory. That makes sure
REM that ssh command creates known_hosts in a directory you have access.
SET HOME=%HOME%%HOMEPATH%

REM Make cwRsync home as a part of system PATH to find required DLLs
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%

REM Windows paths may contain a colon (:) as a part of drive designation and
REM backslashes (example c:\, g:\). However, in rsync syntax, a colon in a
REM path means searching for a remote host. Solution: use absolute path 'a la unix',
REM replace backslashes (\) with slashes (/) and put -/cygdrive/- in front of the
REM drive letter:
REM
REM Example : C:\WORK\* --> /cygdrive/c/work/*
REM
REM Example 1 - rsync recursively to a unix server with an openssh server :
REM
REM rsync -r /cygdrive/c/MyDocuments/ 68.116.46.17:/home/blackrose/My Documents/
REM
REM Example 2 - Local rsync recursively
REM
REM rsync -r /cygdrive/c/work/ /cygdrive/d/work/doc/
REM
REM Example 3 - rsync to an rsync server recursively :
REM (Double colons?? YES!!)
REM
REM rsync -r /cygdrive/c/doc/ remotehost::module/doc
REM
REM Rsync is a very powerful tool. Please look at documentation for other options.
REM

REM ** CUSTOMIZE ** Enter your rsync command(s) here
rsync -r /cygdrive/C/MyDocuments/ root@68.116.46.17:/root
pause
Thank you for your help.

itefix
Offline
Last seen: 4 hours 22 min ago
Joined: 01.05.2008 - 21:33
Re: Kind of lost on this.

<quote>So the directory on my computer is C:\Documents and Settings\Administrator\My Documents
and the debian /home/blackrose/backup</quote>

rsync -r "/cygdrive/C/Documents and Settings/Administrator/MyDocuments/" root@xx.xx.xx.xx:/home/blackrose/backup

should do the job.

Topic locked

Release news