Hello Monks,
I have this situation:
I have installed cwRsync (a Windows port of Rsync: http://www.itefix.no/i2/node/10650 ) on a Windows machine and I'm trying to use Perl to do a lot of stuff.
Finally I ask Perl to invoke my rsync command.

On a DOS console enviroment all runs as well.

But if I insert my Perl program in Windows Scheduling Tasks function, nothing works anymore.
I have already done a little debugging, and I have tried to isolate my problem.
So If I tried to run my Perl program in my DOS console. It contains this code:
system "rsync --version";
All works fine.
I have:
rsync version 3.0.7 protocol version 30 Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others. Web site: http://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, no xattrs, iconv, symtimes rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and y +ou are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.
That sounds good
But If I try to insert my Perl program in Windows Scheduled Tasks, I have this error:
2 [main] rsync 4008 C:\Programmi\cwRsync\bin\rsync.exe: *** fata +l error - couldn't initialize fd 0 for /dev/console
And this is pretty strange:
It seems rsync is not able to have the console from parent process (that is the Perl program)...
I have also tried to set up Environement variables, but without any gains:
$ENV{'CWRSYNCHOME'}='C:\Programmi\cwRsync'; $ENV{'CYGWIN'}='nontsec'; $ENV{'HOME'}='C:\Documents and Settings\saintex'; $ENV{'CWOLDPATH'}=$ENV{"PATH"}; $ENV{'PATH'}='C:\Programmi\cwRsync\bin;' . $ENV{'PATH'};
Moreover the same rsync command, in DOS batch style, works fine also if I call it from Scheduled Tasks:
@ECHO OFF SETLOCAL SET CWRSYNCHOME=C:\Programmi\cwRsync SET CYGWIN=nontsec SET HOME=C:\Documents and Settings\wolf SET CWOLDPATH=%PATH% SET PATH=%CWRSYNCHOME%\BIN;%PATH% rsync -av --delete '/cygdrive/c/Documents and Settings/saintex/Desktop +/to save' '/cygdrive/c/Documents and Settings/saintex/Desktop/myTest'
The rsync command is just a little part of my Perl program, so I can't translate all the stuff in DOS style (and I don't like to do it).
Any ideas?
Suggestions are welcome
Thank you!

In reply to On win32 a scheduling task program doesn't work by saintex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.