Michelle Logan Posted January 24, 2010 Posted January 24, 2010 (edited) I found a script that reminds me to backup our database every two days. One of the script steps is Save a Copy as It works great, my question, is there a way to have the current date automatically appended to the copy to be saved, so we do not have to type it in each time? Thank you M. Logan Edited January 24, 2010 by Guest
efen Posted January 24, 2010 Posted January 24, 2010 Add the following step to the script Set variable $filename; Get ( FileName ) & "_" & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) & ".fp7" before the save as step - amended to: Save a copy as [ $filename; compacted ]
Michelle Logan Posted January 24, 2010 Author Posted January 24, 2010 (edited) Thank you so much, it took a while to make it work and then I had to get my daughter to help me locate where the file was saved. We also made a button that we can do a manual backup as we work from the same script. I just realized that it would be beneficial if the backup had time stamp with it as well as I make more than one backup of our roster during a given day and it would be nice to have more than one backup, as it appears this method overwrites the file each time. Can a time stamp be added to the saved file as well? Thank you again for the information. M. Logan Edited January 24, 2010 by Guest
efen Posted January 24, 2010 Posted January 24, 2010 Use Set variable $filename; Get ( FileName ) & "_" & Substitute ( Get ( CurrentTimeStamp ) ;[ "/" ; "-"]; [ ":" ; "-"]; [ " " ; "_"]) & ".fp7" instead of step used for previous post
Michelle Logan Posted January 24, 2010 Author Posted January 24, 2010 (edited) Thank you again for your help, we finally got it to work. Can you tell me what all the items do as I am unable to locate anything online, and I am attempting to learn as I go. M. Logan Edited January 24, 2010 by Guest
efen Posted January 24, 2010 Posted January 24, 2010 I assume that "items" refers to the bits in brackets. These relate to the Substitute function that precedes Get(CurrentTimeStamp). They replace the reserved symbols that can't be used for naming fields, files etc. (although I don't think that the colon is reserved) in the date and time that is the timestamp, e.g 24/01/2010 22:18:45 In this script step the Substitutes are nested in brackets one after the other: Substitute ( Get(CurrentTimeStamp): [color:purple]{in the particular field, function or $variable} [ "/" ; "_"] ; [color:purple]{this replaces the slash with underscore} [ ":" ; "_"] ; [color:purple]{this replaces the colon with underscore} [ " " ; "-"] [color:purple]{this replaces the space with hyphen} The end bit ".fp7" adds the file extension to the saved file so that it is recognised by FileMaker. (Backup copies are sometimes given the extension ".fpb" instead.)
Michelle Logan Posted January 24, 2010 Author Posted January 24, 2010 You made that very easy to understand. Thanks, M. Logan
Jeffryjon Posted July 26, 2010 Posted July 26, 2010 wonderful solution efan, though I have a newbie dumbo problem. I'm using FM11pro adv and my script editor won't let me paste the script I copied from your post. I've tried several ways but for one reason or another it always rejects - any tips?
efen Posted July 26, 2010 Posted July 26, 2010 I don't understand why not unless you are trying to paste in the complete line from "Set variable ... to .fp7" ? You should only paste in: Get ( FileName ) & "_" & Substitute ( Get ( CurrentTimeStamp ) ;[ "/" ; "-"]; [ ":" ; "-"]; [ " " ; "_"]) & ".fp7" after you have selected the script step: Set variable with the name $filename
Jeffryjon Posted July 28, 2010 Posted July 28, 2010 ok efan, let's see if I can help to show you where I'm going wrong. Here in remote India, power failures, connection failures, backup generator failures are so common it's making life a nightmare. I've also being given the task of designing the database for a very large disaster relief project with no previous skills. Between me messing up, power failures, internet downages etc - these events happen currently 10-30 times a day and the potential sponsors want to see something that works before they'll up the budget from the laptop I'm working on with one of those 4 hour (Really 15 minutes) batteries. So here was my thinking. Under file options, I can select a script to be performed. So let's say I've called that script "MyFile_Timestamped_Backup_Copies" rightly or wrongly, I set an on 'interval ontimer' script to activate the "MyFile_Timestamped_Backup_Copies" script every 60 seconds (obviously once it works properly I'd change that to a more realistic time interval but currently the database has very few records) Since your very quick and kind reply, the "MyFile_Timestamped_Backup_Copies" script has 2 steps: Set Variable $filename and in the second box that offers a value of a calculation [Get ( FileName ) & "_" & Substitute ( Get ( CurrentTimeStamp ) ;[ "/" ; "-"]; [ ":" ; "-"]; [ " " ; "_"]) & ".fp7"] Being a newbie, probably led to a whole set of misunderstandings, but I thought that would then setup the filename with timestamp creator. it didn't work and I'm 99.something sure the fault lies with me. If you could help it would be help me a lot, jeffy
efen Posted July 29, 2010 Posted July 29, 2010 Does the attached help? - backup created automatically with on install timer every ten minutes backup.zip
Jeffryjon Posted August 4, 2010 Posted August 4, 2010 Efan - absolute genius - thankyou so much. Just in case anyone's as dumb as me - after you create a field in your file called LastBackup and place it in a layout, you'll have to open the script called backup and the setfield will say table missing so you'll have to go and find your field by double clicking that scriptstep and finding it in the normal way. If you want to save your backups in another folder than the original, you then have to click on the save a copy scriptstep and then click specify, wipe out what's already in the specify, browse to the right folder - save the file as $filename and FM will automatically add .fp7 to the end - YOU have to manually erase the .fp7 bit again or it messes up the script and you only get one autobackup before FM starts complaining. - thanks again Efan - this is brilliant
Jeffryjon Posted August 5, 2010 Posted August 5, 2010 Apologies for bothering you again Efan (I can imagine the look on your face as you read this). The script runs perfectly EXCEPT when I switch to layout mode and start developing - then it seems to cancel itself. If I go back to browse or any of the user modes it stays cancelled and at this stage I'm spending most of my time in developing. Is there an extra scriptstep or maybe even an extra script. that will keep triggering the auto-backup when I switch between layout and user mode? Secondly, (and I know you might be wishing you'd not got involved in the first place by now), my database is definitely going to need several timer scripts which theoretically could result in 2 or even several trying to trigger at the same precise moment. Which of the following is the most likely result? a) FM triggers the first timed script it finds and loses the rest. FM queues ALL the scripts which are trying to trigger at the same time or c) FM starts crying about things and throws a wobbly The reason I need several timer scripts is we're going to have around 1,000 volunteers turning up in a chaotic situation after a major disaster and each volunteer will be receiving and sending preformatted messages throughout each day (via an internal cellphone network)/ each PC will be doing the same etc etc. I know at some point I'll have to buy a FM server to handle the many users, but I foresee FM itself will have occassions when multiple timed-scripts are trying to trigger at the same time. At the moment though, the first question about switching between developer and user mode cancelling the autobackup is more important. Oh, and when I'm not in a situation like this and bugging the heck out of someone, you might even find me a whole load easier to get along with :)
LaRetta Posted August 13, 2010 Posted August 13, 2010 At the moment though, the first question about switching between developer and user mode cancelling the autobackup is more important. Well, scripts simply won't run in layout mode. If there are Users working in your system, you should develop in another copy and then migrate your Users when ready to put it on line. :wink2:
Søren Dyhr Posted August 13, 2010 Posted August 13, 2010 The script runs perfectly EXCEPT when I switch to layout mode and start developing - then it seems to cancel itself. If I go back to browse or any of the user modes it stays cancelled and at this stage I'm spending most of my time in developing. Is there an extra scriptstep or maybe even an extra script. that will keep triggering the auto-backup when I switch between layout and user mode? Does this development only encompas matters in the layout, not the odd addition of a field and similar crutial issues? The urge to backup usually deals with the data and having interface and raw data in two separate files might be a way to solve your problem. Read up on the separation model ... the issue is to let filemaker perform the backups in the data compartment which then would be a separate file, and then use say myFmbutlers Clipmanager to deal with the appropriate savings in the layout. The big question is then if you constantly feel an urge to a field here and there?? This is a sign of weakness in the datamodel in the first place ... borrowing some metaphors from spread sheets not quite catered for? --sd
Vaughan Posted August 13, 2010 Posted August 13, 2010 Use FM Server to host the file, it can eve be on the same machine. Set FMS to backup regularly.
Søren Dyhr Posted August 13, 2010 Posted August 13, 2010 Yes it's an excellent point, if you enter the: http://www.filemaker.com/technet/?nav=community-button Will for the fee be granted a crippled version of Server hosting only 3 clients though ... but perhaps it suits this purpose?? Details here: http://www.filemaker.com/technet/dev_license.html --sd
Jeffryjon Posted August 13, 2010 Posted August 13, 2010 Laretta, thanks for the 'heads up' on scripts not functioning whilst in developer mode. At least that puts my mind at rest that I haven't inadvertently messed up efan's script. Big help
Jeffryjon Posted August 13, 2010 Posted August 13, 2010 Vaughan, thanks for the FM server tip. All assistance is gratefully received. I had realised that eventually an FM server will be required but potential donors to this disaster relief project want to see something up and running before they drop any more bucks in the bucket. For the last 3 years, we've been mind-mapping the whole process from beginning to end, with very few people actively involved. We've all worked for free (in my case full-time). It's only now that the mind-mapping of all the operations is sufficiently developed that I'm learning databasing from scratch. I think Soren's tip off about the $99.00/year server facility may be of great help in providing a showcase for any big-donors who may want to see the whole thing in action. Has anyone had experience of time-trigger conflicts when 2 or more scripts try to trigger at the exact same point in time (or two or more scripts running in parallel)? Or is this something that 'FM server' takes care of quite easily? Thanks again to you all, Jeffry
Jeffryjon Posted August 13, 2010 Posted August 13, 2010 in response to Soren Does this development only encompas matters in the layout, not the odd addition of a field and similar crutial issues? The urge to backup usually deals with the data and having interface and raw data in two separate files might be a way to solve your problem. Read up on the separation model ... the issue is to let filemaker perform the backups in the data compartment which then would be a separate file, and then use say myFmbutlers Clipmanager to deal with the appropriate savings in the layout. The big question is then if you constantly feel an urge to a field here and there?? This is a sign of weakness in the datamodel in the first place ... borrowing some metaphors from spread sheets not quite catered for? --sd Please forgive me for this lengthy reply (and yes I know it causes this post to temporarily drift off the direct subject matter). I simply don't know how else to explain and I'm very aware that I need assistance in this topic. A small handful of colleagues on a spare-time basis, along with myself are setting up a voluntary organization. The purpose of this organization is to attend a site where a major disaster has occurred. (Let's call it Earthquake Island). The capital of Earthquake Island is Earthquake city and predictably a big earthquake, tsunami or something similar has occurred. We'll work on the presumption that we already have several thousand volunteers with a variety of skills and talents. We need to assess the situation, mobilize around 3,000 volunteers, load up all the right equipment to deal with the situation, (vehicles, equipment tents, field hospital, water processing equipment, food processing equipment, consumables etc etc). We also need to select an 'A-team' based on their profiles of 1,000 or so volunteers to drive/fly/sail to Earthquake city and we need to do it FAST. Needless to say we need to regiment the whole process as far as humanly possible. We already have around 45 Sq metres of mindmaps covering the various aspects which were created in Freemind printed out at 50% size. In a sense of logical processing, we've gone as far as we can in the planning process until we recruit the volunteers, get the buckets full of bucks and buy a small mountain of stuff required to do the job. We can't progress any further until we can impress a few contacts we have who are capable of filling a few of the bucks-buckets by themselves. Understandably, they want to see that their money will be well spent. Now let me try and get nearer to the reason for needing lot's of time-triggered scripting. My background comes from 2 arenas. One is project management (not computers). The other is in fire and rescue and my experience has proven that when a human being works under high pressure for extended periods, his mind suffers from 2 key ailments. a) Tunnel vision - losing track of the bigger picture. : something very similar to 'Obsessive Compulsive Disorder' (Like an Olympic marathon runner who has pushed himself so hard that an outside factor has to be invoked to make him realise that he's crossed the finishing line - otherwise he gets stuck in an infinite loop). We already have B,C,D plans for many factors, but the 'A-plan' is to combine a database with an internalized cellphone wireless network - 1 per volunteer, a bunch of rough-and-ready computers (let's call them laptops) and a bunch of barcode-readers. We have to remind 1,000 or so volunteers when it's time to eat, sleep, wake-up, take a break, attend to a newly allocated (or pre-scheduled) task etc. If we fail to get the desired response from any one of the volunteers within X minutes, we need to send another reminder. If we still get no sensible response X minutes after the second message, we have to send someone to find the guy and check he's ok (hasn't fainted, had a heart-attack, wandered off into the wilderness or being kidnapped [however unlikely the last scenario may seem]). Additionally, if the volunteer is unable to fulfil his task, we need to simultaneously take care of him and direct another volunteer to complete the needed task. To give an idea of what we're going to do, we could reasonably expect anything up to 100,000 refugees to pass through the facility every day for anything up to 4 weeks. (many of them being the same refugees who passed through the previous day). Each refugee will be provided with safe drinking water, (sourced and processed on-site), a meal, medical assessment and treatment in a field hospital. Big expectation, I know, but it can be done. Additionally we'll be gathering personal data from the refugees for several purposes. a) issuing a barcoded ID card : tracking what medical treatment, food and water they've received. c) maintenance of any personal medical data to improve the efficiency of the field hospital d) gathering of other personal data that can assist in repatriation of the refugee I know it's been a long read, but that's about as brief as I can describe what I'm trying to do with FM. I have contact with SAHANA (they're on google like everything else) but they're trying to develop along similar lines with open-source. Their work is great, but for obvious reasons they're developments are to a certain extent generic (and what I need is a complete tailor-made package for precisely and exactly what our organization will be doing). My fear is that because I don't currently have the funds to fly to various places in the world to meet each of their team members face to face, we may take so much time that my dollar-rich contacts lose interest and the whole plan falls apart. Hence here am I, bravely or stupidly, getting myself up to speed with the workings of Filemaker. I may even take a day's rest myself once the database works to my satisfaction. Apologies once again; I'm fully aware that trying to eat my way through such a big meal is my problem, not yours. Any suggestions are gratefully received and acknowledged, Jeffry
Jeffryjon Posted August 13, 2010 Posted August 13, 2010 Does this development only encompas matters in the layout, not the odd addition of a field and similar crutial issues? The urge to backup usually deals with the data and having interface and raw data in two separate files might be a way to solve your problem. Read up on the separation model ... the issue is to let filemaker perform the backups in the data compartment which then would be a separate file, and then use say myFmbutlers Clipmanager to deal with the appropriate savings in the layout. The big question is then if you constantly feel an urge to a field here and there?? This is a sign of weakness in the datamodel in the first place ... borrowing some metaphors from spread sheets not quite catered for? --sd Soren, thanks for the tip on myFmbutlers Clipmanager - I'll try to get a copy as it appears it can overcome some of the difficulties I've been having (importing handwritten scripts)
comment Posted August 13, 2010 Posted August 13, 2010 I wonder if Filemaker is the right tool for the tasks you describe. I'm not saying it is or isn't - only that the question needs to be asked. However, Filemaker is probably the best tool to make a working mockup of the system for presentation purposes. To answer your question about OnTimer scripts: each window has a single timer only. Installing another OnTimer script in the same window will cancel the previously installed script - so there can be no conflict between timed scripts in the same window. OnTimer scripts are run when the application is idle, so I would presume that with multiple windows open, each would add its own script to a queue. However, I cannot say I have tested this very thoroughly.
Jeffryjon Posted August 14, 2010 Posted August 14, 2010 I wonder if Filemaker is the right tool for the tasks you describe. I'm not saying it is or isn't - only that the question needs to be asked. However, Filemaker is probably the best tool to make a working mockup of the system for presentation purposes. To answer your question about OnTimer scripts: each window has a single timer only. Installing another OnTimer script in the same window will cancel the previously installed script - so there can be no conflict between timed scripts in the same window. OnTimer scripts are run when the application is idle, so I would presume that with multiple windows open, each would add its own script to a queue. However, I cannot say I have tested this very thoroughly. Thanks for the info about using separate windows - this sounds like a good workaround. If it works fine in filemaker - fantastic - the jobs cracked. If it helps the people at SAHANA or any other open source whizz-kids to see exactly what's needed, it could speed up making an open-source version a great deal. Either way, I think filemaker is my best bet at this moment. Thanks Comment
Søren Dyhr Posted August 14, 2010 Posted August 14, 2010 Ah!! you're prototyping ... well it has very often been done with filemaker in the past, others have been using hypercard for the same purpose. However must I warn that muckups easily can get out of hand, beyond mending in any serious way. This urge to get something working have unfortunately the flaw that ever so often are elementary measures of normalizations either forgotten or ignored. The best way to develop a database based solution is actually to step back from the machinery and THINK ... and then remind oneself - that all business models falls back on approximately 7 models, anything else is fair and squarely byzantine crincles on the matter that only serves as neat nifty show offs aimed at somebody else than the enduser of the app, or simply incompetance in the developers skill set. Remember that one of the german kings refused Mozart, by saying "...too many notes" Would I then say that any of my temporary running solutions are clinically clenched for such "suburban sprawl" ??... no certainly, these misfits creeps in the cracks and narrow openings when they occur - unfortunately, and usually in stressed situations. Where the client are on the blower, saying "...something here isn't working" I could easily agree with Comment here, a database is perhaps a way too serious tool to throw at a "extinguish-task" --sd
Jeffryjon Posted August 14, 2010 Posted August 14, 2010 Yes Soren I know - I know it may look like I'm trying to create something only seen in futuristic movies. Though some of those we saw back in the 70's and 80's are quite the norm in reality now. Maybe I'll fall flat on my face - who knows - and as I said, we have B,C,D plans for as much as possible (and once we get a wider skill-range in our volunteer base we'll undoubtedly create more). When I was in fire and rescue you'd be quite surprised at some of the C and D plans that you'd never find in the training manuals. Ultimately, I want the database to handle as much as possible, as easily as possible and for as long as it can until the database starts crying. Many of the B plans involve preprinted sheets for various purposes with tick boxes and A,B,C,D,E options etc to make it easier to get the database up to speed on the real-time situation after a possible crash. The UK postal service (where I used to live) use similar techniques for mail-sorting. I could end up punishing FM too severely, though if I can get a working model up and running to show to the open-source experts, they'll have a precise idea of what's being attempted. My experience of software programmers is many (not all) of them gain clearer communication about ideas when they see a working model. Your idea of several 'business' models backed up by a heap of mindmaps help is the approach we took from the beginning. In some aspects it's a bit like inventing the first light bulb was hard, now we have all sorts of varieties. I appreciate the tips from you guys because it also helps prevent me from doing the same as Leonardo da Vinci and 'designing the helicopter' 500 years before anyone could believe it's a real possibility.
comment Posted August 14, 2010 Posted August 14, 2010 If it helps the people at SAHANA or any other open source whizz-kids to see exactly what's needed, it could speed up making an open-source version a great deal. See: http://fmforums.com/forum/showpost.php?post/158544/ :
comment Posted August 14, 2010 Posted August 14, 2010 one of the german kings refused Mozart, by saying "...too many notes" It's not clear to me whose side you're on...
Søren Dyhr Posted August 14, 2010 Posted August 14, 2010 It's not clear to me whose side you're on... Ha ha! I'm attacking my own style of development :
Jeffryjon Posted August 14, 2010 Posted August 14, 2010 Soren, I know this thread is going seriously off-track, though I like your style. (still need any time-trigger tips anyone has!!! : )
bcooney Posted August 14, 2010 Posted August 14, 2010 I vote for Vaughan's suggestion. Join TechNet and download their limited-client copy of FMS. Use a Server script to backup.
Jeffryjon Posted August 14, 2010 Posted August 14, 2010 Thanks Barbara, as soon as I scrape the cash together, I'll be getting it ordered.
Søren Dyhr Posted August 14, 2010 Posted August 14, 2010 Soren, I know this thread is going seriously off-track, though I like your style. (still need any time-trigger tips anyone has!!! It is, but now you have Barbara in on the purchase of the technet membership too... it's probably the best solution - in a case I more than understand, last week was the virgin voyage of a festival ticketing system, where all platforms supposingly should bar-code scan each of the attendee's ticket. But a volonteer firebrigade had the bright idea that switching powerplugs around to suit their needs as well, couldn't do much harm, but the plug they they unplugged was feeding two workstations with a lot of people cueing up to get thier tickets scanned ... and they got the bright idea not just once but several times... for god's sake use UPS'es what ever you do labtops might only be able to keep up, for a short while if the thier batteries have been fried. If you're on macs use this: http://www.hypershop.com/HyperMac-External-Battery-for-MacBook-iPhone-iPad-iPod-s/91.htm --sd
bcooney Posted August 14, 2010 Posted August 14, 2010 Since you've explained your goal, I've been haunted by the memory of a FileMaker solution that was quickly developed to help coordinate efforts for Katrina relief. http://www.filemaker.com/solutions/customers/stories/151.html Have you contacted them?
Jeffryjon Posted August 15, 2010 Posted August 15, 2010 It is, but now you have Barbara in on the purchase of the technet membership too... it's probably the best solution - in a case I more than understand, last week was the virgin voyage of a festival ticketing system, where all platforms supposingly should bar-code scan each of the attendee's ticket. But a volonteer firebrigade had the bright idea that switching powerplugs around to suit their needs as well, couldn't do much harm, but the plug they they unplugged was feeding two workstations with a lot of people cueing up to get thier tickets scanned ... and they got the bright idea not just once but several times... for god's sake use UPS'es what ever you do labtops might only be able to keep up, for a short while if the thier batteries have been fried. If you're on macs use this: http://www.hypershop.com/HyperMac-External-Battery-for-MacBook-iPhone-iPad-iPod-s/91.htm --sd Yes Soren, the 'laptops' I quoted were actually just a metaphor for something much more robust. Imagine a small suitcase that qualifies as carry-on (at least sizewise) on one of our European cheapy airlines. It's guts will be made of desktop/server type components to speed the fixing anything that fries. As far as we've ascertained so far, we will also need an on-site server to handle the 50 or more 'laptops'. Battery backups, portable generators, and jump-leading straight into a truck battery via a battery backup are also options on our list. We're expecting the 'laptops' to get a bit of rough treatment on Earthquake Island - heavy usage, power-outs, power surges etc and the need of extra cooling fans and mini-dehumidifiers. Here in India where I've stayed 8 or 9 of the last 15 years these things are regular daily occurrences. We have contacts here from all over the world and should be able to get them custom-built for well under retail. (Anyway, let's stay low-key on the subject of multinationals subbing out the work to people on less than $5/day) :
Jeffryjon Posted August 15, 2010 Posted August 15, 2010 Since you've explained your goal, I've been haunted by the memory of a FileMaker solution that was quickly developed to help coordinate efforts for Katrina relief. http://www.filemaker.com/solutions/customers/stories/151.html Have you contacted them? There's a new lead for me - thankyou so much Barbara. As you've probably guessed right now, I'm as far away from the US as can be (not because I don't love them). My wife is an Indian citizen and when we're living with the money 'tucked inside my sock' in order to get this thing far enough for those with bigger money to take us seriously, we can live here for a year on what you probably need in a month. Anyway, back on track, I've emailed Charles Durrwachter and asked if he'd be kind enough to look at this thread. Thanks again Barbara, Jeffry
Recommended Posts
This topic is 5213 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 accountSign in
Already have an account? Sign in here.
Sign In Now