in reply to On win32 a scheduling task program doesn't work

Raw guess: Redirect STDIN of rsync to the NULL device, i.e.:

rsync -av --delete '/from/somewhere' '/to/somewhere' < nul

(DOS style)

- or -

rsync -av --delete '/from/somewhere' '/to/somewhere' < /dev/null

(when cygwin provides /dev/null)

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: On win32 a scheduling task program doesn't work
by saintex (Scribe) on Jun 21, 2010 at 08:24 UTC
    With this syntax:
    rsync -av --delete '/from/somewhere' '/to/somewhere' < nul
    But Why?


    It is useful to know, that I do a redirect of both STDOUT and STDERR on a lo file.
    But I don't thing that is related to STDIN:
    $| = 1; # no output buffer open LOG, ">", LOG_FILE # LOG_FILE settings are in toConfig.pm or warn "Can't create LOG FILE: $!"; close LOG; open STDERR, ">>",LOG_FILE or warn "Can't redirect STDERR: $!"; open STDOUT, ">>",LOG_FILE or warn "Can't redirect STDOUT: $!";
    UPDATE
    It seems that all works fine, also without STDIN redirect, if I try to call my Perl program from Windows Scheduled Tasks, with that syntax:

    cmd /c "C:\Documents and Settings\saintex\Desktop\saintex-backup\backup.pl" -m alternative

    This way is also important to send options to perl file (without 'cmd /c' no options are passed to Perl program).

    Thank you all!