Jump to content
Server Maintenance This Week. ×

Command File won't open FM (for automated cleanup)


This topic is 6652 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hey All,

I am trying to use FMServer 5.5 to run a command file each night.

The purpose of the command file is to run a Filemaker Pro "database"

that archives my main company databases. It is modeled after the

Filemaker example for recalculating the "Today" function.

Basically I have the FMServer set to close all company files (using

a command file) at 12 midnight. This has been acheived successfully

each night. FMServer then runs another command file at 12:30 to open

all the company databases. This has been running sucecssfully. Finally,

I scheduled FMServer to open a "database" on the server (using a

command file) that automatically archives the main company databases

(i.e. this "database" automatically uses the administrator password,

and it has a startup script that automatically opens the company

databases, performs various housecleaning tasks, and then has an "exit

application" script step.)

If I simply "double click" on the command file I created, all of

this is performed successfully. The problem comes when FMServer calls

this command file. If I go to the scheduled tasks in FMServer and click

"run now" (or if FMServer runs the task when it is scheduled at 12:05)

the only thing that happens is that "Filemaker Pro.exe" shows up in the

process list of the server. I can't "run" filemaker from the server

anymore becuase I get an error saying that I have a single user license

and another user is running filemker... I am thinking that perhaps my

command file is not correct? Here is the file:

@echo off

set FMSDir=c:Program FilesFileMakerFileMaker Server 5.5

set FMPDir=c:Program FilesFileMakerFileMaker Pro 6

set FMP="%FMPDir%Filemaker Pro.exe"

%FMP% "%FMSDir%MyDatabaseauto_Archive.FP5"

I haven't even tried restarting the server yet, so that could solve it,

but I won't be able to do that until tonight... Any help is

Link to comment
Share on other sites

So if you run it manually it works fine but if the Task Scheduler runs it it fails? Do I have this right?

If so try changing your scheduled task so that it runs under your account rather than the local system account. You may have to use a syntax like: DomainUsername to make it work.

Link to comment
Share on other sites

  • Newbies

This sounds like it would make it work, but I don't completely understand how to do what you are suggesting...

I know how to schedule a task through the native task scheduler to do this, but not through FM Server (i.e. the server scheduled task just gives a path to the file and no option for what user to use...)

Should I modify the path somehow such as DomainuserC:file :

Link to comment
Share on other sites

I'm sorry, I misunderstood. I thought you were running the FileMaker app from a workstation but using files that were located on the server.

I've not done anything like you are suggesting. For one thing I think FileMaker recommends that you not install or run the client app on the server that hosts the files. This was their recommendation on older versions and I think it still holds true.

Can you run it from a client workstation? This is how I do automated import/exports and it works well. Does it really need to be triggered from the server? I know it makes a lot of sense to think of it being server based but FM doesn't really work that way.

Link to comment
Share on other sites

  • Newbies

Ah,

That makes sense... Yeah right now everything is running on the server. I guess I could put it on a client, but the only problem is that I've locked down the folder that the database sits in so that it isn't shared. The only way to access it it through the filemaker server.

I guess I could just schedule FMServer to re-open the files and then have the client archive everything just after that? Thoughts?

Maybe I could just use the native event scheduler of the server?

Link to comment
Share on other sites

If you are just trying to get a copy of the database files for backup that should be doable from the server.

You are on v6 right? The backup procedure changed a bit with the introduction of v7 but the general steps are the same.

1. Pause the FM database files.

2. Use Windows Shell scripting to copy the paused files to another folder.

3. Resume operation of the files.

You would then use your backup software to backup the copies. I can't remember the exact syntax but I think somewhere in the server documantation was an example script. And when I say script, I don't mean a FileMaker script, I'm talking about a .bat or .cmd script.

Since I'm an old geezer my memory isn't a good as it was when I was a young buck but I think I have the general steps down.

If you're doing other stuff where you need to initiate actual FileMaker scripts then you should really consider having a PC that acts as an "Agent" of sorts. I think this is the more conventional way of automating internal FileMaker tasks.

Link to comment
Share on other sites

  • 2 months later...

Ted,

When you are automating imports/exports how do you handle the filenames? Currently I need to both import and export but I'm doing it manually because I haven't figured out a way to import/export different filenames.

On Import, we receive new files that always have a different name.

On Export, I'd like to automate this process but I don't know how to name the files unless I do it manually.

Any help would be great.

-Tony

Link to comment
Share on other sites

This topic is 6652 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.