Solved

Filemaker Server Schedule Batch Script Running No Result

Posted on 2014-02-23
6
947 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:jwleys
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now