scheduled task doesnt work

Home Forums Server Operating Systems Windows Server 2008 / 2008 R2 scheduled task doesnt work

This topic contains 4 replies, has 4 voices, and was last updated by Avatar krayzie 9 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Avatar
    krayzie
    Member
    #149713

    hey guys im trying to schedule a cwrsync.bat it runs fine when me (enterprise admin) can double click the batch script and it will runTask Scheduler successfully finished “{7e342c2e-2fdf-45e1-8f29-c1ef22cd2be3}” instance of the “rsync” task for user “domainuser”.

    -i have assigned the local administrator account to run the schedule but every time it runs it says complete with out the cwrsync process running-the administrator has login as batch.-i have ticked the run whether user is logged on or not

    -i have ticked run with highest privileges-configured for: vista /server 2008

    -in actions i have set the “start in” to :C:Program Files (x86)cwRsync

    -administrator has full access to the batch file and C:Program Files (x86)

    i have added the 2nd line to see if the script even runs to create a txt file.. but i never get the txt file

    here is the cwrsync batch file

    @echo OFF
    echo %date% %time% %username% >> c:test.txt
    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=%USERPROFILE%

    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

    REM ** CUSTOMIZE ** Enter your rsync command(s) here
    @echo OFF
    SET SECHAW_IDENTITY=”D:putty keys59.key”
    SET SECHAW_TYPE=ssh
    SET SECHAW_LOCALPORT=9119
    SET SECHAW_SERVER=10.158.60.16
    SET SECHAW_SERVERPORT=873
    SET SECHAW_USER=s59
    SET SECHAW_CMD=”C:Program Files (x86)cwRsyncbinrsync.exe” -azvr –delete rsync://localhost:9119/Screensaver /cygdrive/d/screensavers/
    SET SECHAW_TUNNEL=ssh -i “D:putty keys59.key” -L 9119:127.0.0.1:873 [email protected] -T -N
    “C:Program Files (x86)cwRsyncbinsechaw.exe” –verbose

    ideas would be much appreciatedTHANKS!!!!!

    Avatar
    Silver23
    Member
    #292269

    Re: scheduled task doesnt work

    would you have an option to put the bat file in another location; perhaps/probably something is going wrong with the path you specified in the task scheduler.

    Perhaps try %programdata% instead.

    Avatar
    vonPryz
    Member
    #347468

    Re: scheduled task doesnt work

    A common reason for failing batch jobs is that you are running the task with an account that is not permitted to log on as batch job and/or run cmd.exe.

    Check security policy for logon as batch job right. The proper policy depends whether the computer is in a domain and/or is DC or member server.

    Make sure the batch file will not require any logon-script mapped network drives and that all the task paths are absolute paths too.

    -vP

    Avatar
    krayzie
    Member
    #350665

    Re: scheduled task doesnt work

    i tried it in the programdata dir and ran successfully but the script didnt run

    i have added the specific user to login as a batch job

    i have even tried it with the administrators account but it didnt work

    the server is a member of a domain but not a DC

    it does not require any login scripts as it is calling a ssh function

    Rems
    Rems
    Moderator
    #227761

    Re: scheduled task doesnt work

    Test it again after you have disabled UAC.
    Accounts in the local Administrators group have two access tokens under UAC, one with standard user privileges and one with administrator privileges. Normally, the administrator runs under the standard user privileges unless it was explicitly promoted.

    Rems

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.