Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Savery

  • Rank
  1. Did you ever get this to work? Would be very interested to know how you got on, even if the experience was a bad one.
  2. Have you considered placing a send-single command within a loop which get the next email address from a list held in a variable?
  3. I've written a simple shell script command to join two files together using cat. From the command line I would write something like: cat fileA.txt >> fileB.txt My shell command, which compiles, is: RegisterGroovy( "AddToFile( addfrom ; addto )" ; "String[] cmd = ["cat", addfrom, ">>", addto];¶ Process process = Runtime.getRuntime().exec( cmd );¶ String processResult = process.getInputStream().getText();¶ process.waitFor();¶ exitValue = process.exitValue();¶ return processResult;" ) However, this merely returns the contents of each file and does not add the contents of fileA.txt to fileB.txt. Any thoughts?
  4. This typo is in the bundled version Also, I cannot fathom why it won't support compressing a directory. Any ideas?
  5. The scripts are indeed being run as 'fmserver'. Now I just need to determine whether this user can scp. Could be that this is the problem. All other tasks are fmsadmin commands, bar one (which is independent of user).
  6. Right, so the 'scp' command in my shell script would need to be a fully-qualified path. I'll give that a try, although I should add that other commands before 'scp' all run fine without full-paths. The shell itself starts with the #!/bin/bash which I assumed, rightly or wrongly, would give the system enough to know where everything lived. One more thing that I've not been sure of: who is running the commands? Would it be logged-in user of the server, or fmserver user? I can't remember now whether I've allowed for either or both of these when modifying the sudoers list as I've been going round in circles lately. Thanks for your input - very very welcomed! :
  7. I 'made' a new instance of the 'do shell' function so that I could pass parameters separately: RegisterGroovy( "ExecuteBackup( FMAdmin ; FMPass ; FMDatabase ; DGUser ; DGServer ; LocalVol )" ; "String[] cmd = ["./dg_backup.sh", FMAdmin, FMPass, FMDatabase, DGUser, DGServer, LocalVol ];¶ Process process = Runtime.getRuntime().exec( cmd );¶ String processResult = process.getInputStream().getText();¶ process.waitFor();¶ exitValue = process.exitValue();¶ return processResult;" ) Does this look like it could cause a problem? The shell script called uses double-quotes around all variables.
  8. All I was getting back was 'ERROR', which, while true, wasn't particularly informative. : I have add the -v arg to my scp line in the shell script and will report back as soon as I can.
  9. I've written a little shell script which essentially takes a backup of a FM database (from passed arguments). The last step is to scp the ZIPd file back to our remote server. Testing the script from the command line works a treat. We get a lovely fresh copy of the database archived and sent to our remote server using scp. However, if I use 360Works SM to call this shell script with the same parameters it fails when attempting the scp command. Note: I am calling the FileMaker script, which uses SM to call the shell script, as a scheduled task in FileMaker Server Advanced 10. There is a very good reason for this, and this means that, unfortunately, this cannot be changed. I'm 99% certain that this is not a SSH problem as I've used keygen to share the keys and this is proven to work time and again from the command line. Have I hit some weird limit of SM? I'm happy to post snippets of the code that I'm using, if you feel it'll help you diagnose the fault. TIA, Steve
  10. Thanks for this info. Interesting that even if this feature existed there'd still be problems using Fields IDs. Oh well, I'm still holding out hope for a solution or workaround which will help. Your link was interesting, but I couldn't see a way which it could be adapted to fit my current needs. Bookmarked it (remember those?*) for future reference. *I seem to use Digg etc more than bookmarks these days as I don't have a laptop and end up hopping from one computer to another.
  11. Why-o-why can't we yet specify the Import source and destination tables based upon a calculation/variable? I realise that mapping the fields would be a daunting task, so how about just 'Matching Field Names' or 'Last Order' as the options to choose from? Then, also give us the ability to do the reverse i.e. export our data with the same controls. Field mapping could be achieved with the FieldNames ( fileName ; layoutName ) and TableNames ( fileName ) functions to get an array of the field names and types for both destination and source tables. But this would be a laborious task to setup in some cases, but not all. A script could be written in such a way to use these functions that could then handle any table/database. However, in most cases you would want to map using matching names. But knowing how many tables need exporting, importing would be useful for growing solutions. I strongly believe this is a huge hole in the offerings to Advanced developers. Having many solutions in many environments means having to keep tables and fields matched in live and offline/archive systems. You may be thinking, why not just Save As Copy or Export each table... well you can do this, but it reduces flexibility of the solution and adds to the development cycle with extra work to keep any such scripted methods up to date. Even exporting the data using TAB, CSV or similar. However, the only guaranteed method for extracting data from FileMaker and keeping it in the same format (I'm looking at you formatted text fields!) is to keep it in the FileMaker file format. As you can probably tell, I'm a bit frustrated by this. I've searched high and low to find a plug-in which could emulate this feature. Nothing ticks all the boxes. I've contacted some plugin developers and, while they've been helpful and sympathetic, none have been able to produce a workable solution. Here's hoping that this is a feature that is looming around the corner with a future update. I just hope it isn't version 15. ???
  12. I read your reply far too quickly, clearly. Thank you! I think Spent far too long on this before asking for help.
  13. Thanks for persevering with me. I have two fields with lists within them (simplified) Substitute_Tags: [##NAME##] [##EMAIL##] Substitute_FieldNames: Full_Name Email Full_Name: Steve Savery Email: somewhere@somedomain.org Ignore the first field for a moment. What I want to do is look at row n of Substitute_FieldNames and get the value of the name of the that field. So, in this example if I wanted row 1 of Substitute_FieldNames I'd get "Steve Savery" as the result. My loop encompassing all that I want to achieve would go something like this: Set var $count = 1 Loop Substitute ( GetValue ( Substitute_Tags ; $count ) ; GetValue ( Substitute_FieldNames ; $count ) ) Exit Loop If $count > PatternCount ( $count ; "returnsymbol" ) + 1 End Loop But, the flaw in this Substitution is that I don't want to replace [##NAME##] with "Full_Name" but with the contents of the field with the name of "Full_Name". Hope that is clearer. :)
  14. Maybe the AllFields (start ) function will be a workaround. I could add the fields we're likely to need to a new layout and make sure people know to order the tag name in the correct order (using false tags where an non-required field falls).
  15. I was afraid I hadn't explained myself clearly enough... I can do the substitution (360Works comes with a BodySubstitution function which works fine). What I am trying, and failing, to do is use a text field to contain the names of the fields I'd like to reference as the 'replace with' values. So, say I have a text field called 'ReplaceWithValueFrom' which contains the value 'Customer_Number'. What I want to do is use a Substitution something like this: Substitute ( GetValue ( $tags ; $tag_row ) ; GetValue ( $replacefield ; $replace_row ) ) But I can't see any way of getting the value of a field by being able to reference it in this way. Seems I have to use GetLayoutObjectAttribute which would mean having to name every field object. I could do this, of course, but it wouldn't be as flexible as I'd like the solution to be (ie we would be restricted to use only fields which have been named as objects).
  • Create New...

Important Information

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