Newbie with (hopefully) a simple question.

nnCron and nnCron LITE discussion

Newbie with (hopefully) a simple question.

Postby DrSiddons » Mon, 28 Aug 2006, 16:37

Good Day!

I'm trying to set up nnCron to move files from one location to another every minute.

I thought I could use the Windows 'MOVE' command: (MOVE c:\filepath\*.fxr y:\).

I also thought I would set this up in a script.

I used ccCron's GUI editor to set up a new task. I set the time and chose the run script option under the Action tab.

I keep getting a syntax error from nnCron.

What do I need to do to correct this? Thanks in advance for the help.

DrSiddons
DrSiddons
 
Posts: 4
Joined: Mon, 28 Aug 2006, 16:27

Postby Valery_Kondakoff » Mon, 28 Aug 2006, 16:51

Please, take a look into your nncron.tab and post the source code of the task in question. We will look into it and try to help you.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

syntax

Postby DrSiddons » Mon, 28 Aug 2006, 16:56

Here's the content of crontab:

~~~~~

#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Years Command
# see 'example.tab'

#( purge-cron-log
Time: 0 12 * * 5 *
Action: PURGE-OLD: "log\*.log" 7
)#


#( Move_Fax_Files
Action:
move C:\Program Files\WinFax\Data\*.fxr "y:\"
)#

~~~~

Thanks.

DrS
DrSiddons
 
Posts: 4
Joined: Mon, 28 Aug 2006, 16:27

Postby Valery_Kondakoff » Mon, 28 Aug 2006, 17:08

'move' is an internal command of your command line interpreter (comspec). so, you should call your comand line interpreter first.

Try this. Replace your Move_Fax_Files task in your crontab with these lines:

Code: Select all
#( Move_Fax_Files
Action:
START-APP: %COMSPEC% /c move "C:\Program Files\WinFax\Data\*.fxr" "y:\"
)#


This code will call 'move' at the top of every minute.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Progress!

Postby DrSiddons » Mon, 28 Aug 2006, 17:20

O.k. Thanks for the fast response!

The script runs without triggering an error. However the files are not being moved.

??? What is the next step?

DrS
DrSiddons
 
Posts: 4
Joined: Mon, 28 Aug 2006, 16:27

Postby Valery_Kondakoff » Mon, 28 Aug 2006, 17:46

The following example works fine on my PC:
Code: Select all
#( Move_Fax_Files
NoActive
Action:
START-APP: %COMSPEC% /c move "C:\Program Files\WSWATCH\*.wav" "c:\"
)#


Are you sure you have _replaced_ the previous task with the same name and reloaded the crontabs? If there is a chance there are fxr-files with the same name on the target drive?

If there is smth unusual in nncron.log and nncron.out?
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby Valery_Kondakoff » Mon, 28 Aug 2006, 17:52

Ah... I see: the drive 'y:' is a mapped network drive? Then you need to authorize the task to have access to the network.

Smth like this:

Code: Select all
#( Move_Fax_Files
AsLoggedUser
Action:
START-APP: %COMSPEC% /c move "C:\Program Files\WinFax\Data\*.fxr" "y:\"
)#


HTH!
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Success!!!

Postby DrSiddons » Mon, 28 Aug 2006, 18:06

Now that got it!!

Thanks for your help. Indeed your fast help.

DrS
DrSiddons
 
Posts: 4
Joined: Mon, 28 Aug 2006, 16:27

Postby Agen » Wed, 20 Sep 2006, 16:37

I am Trying to do the Same thing but getting an Time Error message not sure why this is. i have even tried to leave the time option absent to make the program run ever minute just to get it to work. here is what i have.

#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Command


#( Move_Log
Action:
START-APP: %COMSPEC% /c
copy /y z:\W3SVC1\*.* d:\LogFiles\
)#


I had a time set to this: Time: 1 * * * *


From hte online help i pulled this :
#( test_task2\ 'Time:' section is absent, so the task\ will be executed every minuteAction: \ ... performing some useful actions)#


the error i am getting is this:
07:56:54 5056 Start nnCron
07:56:54 5056 Load cron.tab
07:56:54 5056 WARNING: line:2 pos:6. Invalid time specification. Possible range is [0-59].
07:56:54 5056 WARNING: line:3 pos:8. Invalid time specification. Possible range is [0-59].

and My cron out is this:
nnCron LITE. v 1.17 Build 119 09.06.2005
Copyright (C) 2000-2006 nnSoft. e-mail:nemtsev@nncron.ru

Error macro variable substitution [-2003]:CUR-TAB-FILENAME COUNT
EXCEPTION! CODE:C0000005 ADDRESS:4B226E WORD:C@ REGISTERS:
41ECBC 94 1E 42 00 0C 00 00 00 00 A0 42 00 00 00 00 00 ”.B...... B.....
41ECCC 00 00 00 80 00 00 00 00 44 FF 41 00 6E 22 4B 00 ...Ђ....DяA.n"K.
41ECDC 1B 00 00 00 46 02 01 00 EC EE 41 00 23 00 00 00 ....F...моA.#...
USER DATA: 421E94 HANDLER: 41EF60 RETURN STACK:
41EEEC : 4D0BE0 ">'
41EEF0 : 80000DB4 TASK-#-1
41EEF4 : 7FBD6DB4 <not in the image>
41EEF8 : 4D0C28 ">'
41EEFC : 4D0CEC CUR-TASK-NAME
41EF00 : 4D2924 TimeCRC320!
41EF04 : 4D29A5 TimeCRC32
41EF08 : 4D2AB4 renewTI
41EF0C : 4B2C48 (LocalsExit)
41EF10 : 4 <not found>
41EF14 : 0 <not found>
41EF18 : 4D6A59 TASK;
41EF1C : 4DAF9F TASK-#-1
41EF20 : 4D6ACF CLASSIC-TASK
41EF24 : 4D6BF7 Classic:
41EF28 : 4B5E8C REFILL
41EF2C : 4B7B4F INCLUDE-FILE
41EF30 : 9 <not found>
41EF34 : 0 <not found>
41EF38 : 5C <not found>
41EF3C : 20 <not found>
41EF40 : 12 <not found>
41EF44 : 42794C <not found>
41EF48 : 4B7C1B INCLUDE-PROBE
41EF4C : 4B7CD3 INCLUDED
Agen
 
Posts: 11
Joined: Wed, 20 Sep 2006, 16:28

Postby Valery_Kondakoff » Wed, 20 Sep 2006, 17:04

You are trying to use the nnCron extended crontab syntax in nnCron LITE, which supports classic crontab syntax only.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby Agen » Wed, 20 Sep 2006, 18:36

ok, i have changed to the nncron, now i am getting a syntex error;

Move_Log: Crontab syntax ERROR!!!. Task file: C:\Program Files\cron\nncron.tab. Line: 9
10:27:50 5384 Console server is started.

basicly i need to copy the files 2 times a year from a web server to the reports server. windows schedule will not run my batch files so i am looking into a new process that will allow me to do this and i am hoping that this will work.

I have also downloaded the nnbackup and tried the filecopy command with the nnbackup but the files are not being copied.
Agen
 
Posts: 11
Joined: Wed, 20 Sep 2006, 16:28

Postby Valery_Kondakoff » Wed, 20 Sep 2006, 23:03

If this is your actual task

Agen wrote:#( Move_Log
Action:
START-APP: %COMSPEC% /c
copy /y z:\W3SVC1\*.* d:\LogFiles\
)#


just remove the line break between START-APP: and 'copy'.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby Agen » Thu, 21 Sep 2006, 15:31

OK i got it to work once but now getting error!

07:22:25 936 Start nnCron
07:22:25 936 Load crontab
07:22:25 936 C:\Program Files\cron\nncron.tab
07:22:35 936 Move_Log: Crontab syntax ERROR!!!. Task file: C:\Program Files\cron\nncron.tab. Line: 8
07:22:36 4144 Console server is started.

here is the code:

#( Move_Log
Action:
START-APP: %COMSPEC% /c
copy /y z:\W3SVC1\*.log d:\LogFiles\ <--- Line 8
)#

not sure if this makes a diffrence, my Z drive is a mapped drive with the credentials stored within the mapping.
[/b]
Agen
 
Posts: 11
Joined: Wed, 20 Sep 2006, 16:28

Postby Lynx » Thu, 21 Sep 2006, 16:07

You were tould to get rid of line break in START-APP line :)
Code: Select all
#( Move_Log
Action:
START-APP: %COMSPEC% /c copy /y z:\W3SVC1\*.log d:\LogFiles\
)#


PS. You can use nnCron-words to copy files.
User avatar
Lynx
 
Posts: 321
Joined: Thu, 04 May 2006, 20:07
Location: Уфа

Postby Agen » Thu, 21 Sep 2006, 16:37

sorry i will Screw my head on before i post again.

ok i got it working but the files are not coping. i am not sure if cron is starting and stoping to fast.

i did try to run nncron new task, i ran an application which points to a small batch file. which copies the files. that did not work either but i am not getting an error. is there a way to pause nncron until the job is finished?
Last edited by Agen on Thu, 21 Sep 2006, 18:09, edited 1 time in total.
Agen
 
Posts: 11
Joined: Wed, 20 Sep 2006, 16:28

Next

Return to nnCron forum (English)

Who is online

Users browsing this forum: RobertFaity and 0 guests