Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/07/2012, 10:16
Sys_VUn
 
Fecha de Ingreso: septiembre-2009
Ubicación: DF
Mensajes: 20
Antigüedad: 14 años, 7 meses
Puntos: 0
Rsync no funciona como tarea programada

Saludos amigos,
Tengo un servidor Windows Server 2003 y tiene instalado rynsc para realizar respaldos y el destino es un servidor Linux. La comunicaciòn funciona correctamente puesto que si ejecuto el archivo cwrsync.cmd se ejecuta el respaldos. Ahora si ese mismo archivo lo coloco como tarea programada, el proceso de queda en estado running sin que se finalice.
La pregunta es porque funciona bien ejecutàndolo en el MS-DOS y no como tarea programada?
Les dejo el codigo del cmd

@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 Make environment variable changes local to this batch file
SETLOCAL


REM ** CUSTOMIZE ** Specify where to find rsync and related files (C:\CWRSYNC)
SET CWRSYNCHOME=%PROGRAMFILES%\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=%HOMEDRIVE%%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/work/ remotehost:/home/user/work/
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 ** CUSTOMIZE ** Enter your rsync command(s) here

rsync -avz /cygdrive/c/archivo1.txt root@IP_DESTINO:/RUTAdestino > log.txt

La lìnea de arriba indica que voy a copiar el archivo1.txt en el servidor destino, en la ruta indicada y que eso lo escriba en el archivo log.txt el cual crea sin problema. Incluso hice la prueba en Windows XP y la tarea se ejecuta correctamente.

Por favor, alguien podrà ayudarme? Que debo hacer?
Gracias