Countfiles on a network drive

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Rob H
Newbie
Posts: 2
Joined: Mon Jul 31, 2006 6:33 pm

Countfiles on a network drive

Post by Rob H » Mon Jul 31, 2006 7:57 pm

have a script running to notify me if a certain type of temp file starts building up. Most of the time this works perfectly, but on occasion it will fail for a couple hours before spontaneously working again. Here is the script:

Let>SENDMAIL_STATUS=1
Let>subject=ODB Found
Let>me=[email protected]
Let>myname="[email protected]"
Let>recipients=[email protected]
CountFiles>f:\macola70\data\*.od*,odbcount,0
if> %odbcount% > 5,ODBFound,ODBNotFound
label>ODBFound
Let>body=%odbcount% OD* Files Have Been Found In The Macola Root
SMTPSendMail>recipients,mail.work.com,me,myname,subject,body,
label>ODBNotFound


It's been difficult to catch while it's failing. While it's failing, in Windows Explorer I can see the *.od* files sitting there, (there are more than 5), but this is what the log says:

7/31/2006 13:34:00:265 - Started Macro : Notify Of ODB FailOver
7/31/2006 13:34:00:499 - Let>SENDMAIL_STATUS=1
7/31/2006 13:34:00:531 - Let>subject=ODB Found
7/31/2006 13:34:00:531 - Let>me=[email protected]
7/31/2006 13:34:00:531 - Let>myname="[email protected]"
7/31/2006 13:34:00:531 - Let>recipients=[email protected]
7/31/2006 13:34:00:546 - CountFiles>f:\macola70\data\*.od*,odbcount,0
7/31/2006 13:34:00:546 - label>ODBNotFound
7/31/2006 13:34:00:546 - Finished Macro : Notify Of ODB FailOver


This is a NetWare 6.5 network with the latest client (4.91 sp2). The workstation is Windows XP with current updates. Macro Scheduler is 8.03 upgraded from 7.4. The problems started occurring about 2-3 times a week after the upgrade. The macro runs continuously every 5 minutes. There are two identical macros running on the same machine that look at different directories on a windows server. I've not had a similar problem with those, but it is rare that either of those is triggered

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Jul 31, 2006 8:52 pm

I don't have a netware system to test this on but is it possible that the server has the files locked such that the countfiles> function does not see them if the files are in use?

That could explain it spontaneously working again (when then app turns loose of the file.)

Just a thought,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jul 31, 2006 9:41 pm

Your script will always branch to ODBNotFound because of the spaces in this line:

if> %odbcount% > 5,ODBFound,ODBNotFound

This line needs to be:

if>%odbcount%>5,ODBFound,ODBNotFound
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Rob H
Newbie
Posts: 2
Joined: Mon Jul 31, 2006 6:33 pm

Post by Rob H » Tue Aug 01, 2006 12:28 pm

JRL,

It is possible and even likely that one of the files is locked by the program that should be processing them, but the rest of them would not be. I'm not sure what process countfiles uses to count the files, but I wouldn't think that a file lock would hide the existence of the file. Also the lock would not clear, until after the it started working and I went to clear the error.

mtettmar,

Thank you, I will change that and see if it works. But it doesn't always branch to ODBNotFound. Most of the time it works as we want it to. Only on occasion does it fail, and then it begins working again after 2-3 hours.

Thanks,

Rob

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Countfiles on a network drive

Post by macroman » Fri Sep 30, 2016 9:49 am

i am having the same issues right now, it cannot count files on a mounted network drive.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts