Solved

Filemaker Server Schedule Batch Script Running No Result

Posted on 2014-02-23
6
988 Views
Last Modified: 2014-03-23
Hi there,

I am still having trouble getting FM Server to run an external script. I have set up a schedule to run a batch script (a URL call in IE). When I manually run the batch script it works as expected. When it is scheduled it runs OK (according to the scheduler) but nothing actually happens. I have tried setting the scheduled script to use the Administrator account for the server, as well as the default account, but both give the same results (i.e. nothing). The .bat file permissions are set to execute for all accounts.

The .bat file is very simple:
start "~\\iexplore.exe" "fmp://[username]:[password]@[mydatabaseIP][myfile]?script=[script]"

Open in new window

0
Comment
Question by:jwleys
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:grnassar
ID: 39882266
So, just to be clear: you're running an external script whose purpose is to run an internal script?  ("?script=[script]")

When you say that it runs "as expected" when you run the batch script, are you running it on the server or on a local machine?  And what is the expected result?

If you're running it locally and it works, my guess is that you haven't installed the FileMaker Pro client on the server -- the batch file is, of course, launching FMP in its one line, so if you want that to run on the server you'd need the client installed there too.

That being said, that usually means there's a better way to do what you want to do (perhaps being simply to run the FM script from the server directly instead of using an external batch file).
0
 

Author Comment

by:jwleys
ID: 39883945
Hiya, thanks for your help.

Because FileMaker server has limited functionality available through its scripts I have triggered a shell script call from the server – that .bat file calls the client copy of FM Pro that is also on the server to do what FM server cannot. The server acts as both FM server and a robot machine running a FileMaker Pro client.

I have tested everything from the server directly.

The batch script runs fine on the server. The expected result is that it calls the client copy of FM Pro on the server, and triggers a script from within the client. When I schedule the server to call the batch script however, nothing happens – that is my dilemma. It looks like the schedule fires fine, with no error reported, but the batch script does not work as it does when run manually. I have sorted out a work-around for now (using on-timer scripts on the server's FM client), but still want to know why this wasn't working, as I may wish to call other shell scripts in the future . . .

In the schedule I have used the administrator login to run the batch script, including
./
before the username, as suggested by FM. It doesn't appear to be a permissions problem – it might be, but I'd expect to see an error? See attached log example – the schedule thinks it is running fine.

Hopefully that is clearer than mud ;–)
Screen-Shot-2014-02-25-at-10.17..png
0
 
LVL 1

Expert Comment

by:grnassar
ID: 39888319
The schedule thinks it's running fine because it's running iexplore.exe.  Internet Explorer isn't going to return an error from command line if FMP has trouble launching.  And FMP is probably going to have trouble launching, because you're most likely running the scheduled script from the "default account" -- which is Local System, which doesn't launch a Windows console.  No Windows console, no way to create a new window -- no new window, no FMP client.

You may be able to solve the problem by running the script as some regular user instead of using the default account; it's probably worth a shot.  If not, the typical way to do this sort of thing anyway is to schedule the task with Windows' Task Scheduler, not the FMS scheduler -- may have more luck that way.

That being said, these days there's not much that can't be done from an FMS script -- sure, some script steps won't run, but that's more because there's a better way to do them from FMS rather than because they just can't be done.  If you don't mind my digging a little deeper into the problem, what is the script supposed to do?
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:jwleys
ID: 39890018
Hi there,

I have tried running the schedule as both the default account and the administrator account (which appears to run fine as well). I still suspect this is a permissions / account issue, but can't figure it out.

The FM client script is required to create PDFs on the server and store them, as WebDirect users (the most common user type for this database) cannot do this.
0
 
LVL 1

Expert Comment

by:grnassar
ID: 39914138
My apologies -- I've been posting from a dead account without realizing it.  Reposting as my current account.
0
 
LVL 6

Accepted Solution

by:
slinkygn earned 500 total points
ID: 39914158
There, sorry about that.  I wish there were a way to merge accounts in EE so I didn't have to juggle like this!

Again, the most plausible solution is to run your batch file as a Windows scheduled task, not as a FileMaker server-side script.  Have you tried that yet?
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

To effectively work with Diskpart on a Server Core, it is necessary to write some small batch script's, because you can't execute diskpart in a remote powershell session. To get startet, place the Diskpart batch script's into a share on your loca…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question