Jorgen Posted March 28, 2008 Share Posted March 28, 2008 I would like to make a script with the following possibilitys. 1: User fill in path for backup (example: c:\database\backup) 2: User fill in filename (example: contact.fp7) 3: Press go button I already tryed to make something with all kind of fields but i ran into a cmd problem. With to go button i created a simpel batch file with the copy command inside it. xcopy c:\database\contact.fp7 c:\database\backup\26032008 contact.fp7 When there are more copy commands in this batch files it will copy the first copy command but not the second. I know there is a more simple way "save a copy as" but..... Tnx Jorgen! Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted March 28, 2008 Share Posted March 28, 2008 I'm not sure I can help with the commands. but please never ever perform backups on live databases, it is a source of data corruption. If you have filemaker server, use it's built-in scheduler to create regular backups safely. If you don't have Filemaker Server, close the database before performing the backup. Quote Link to comment Share on other sites More sharing options...
Jorgen Posted March 28, 2008 Author Share Posted March 28, 2008 smiley-cry Ok, i keep it in mind. I will find out another way Tnx Kjoe Quote Link to comment Share on other sites More sharing options...
jcoffey Posted May 14, 2008 Share Posted May 14, 2008 I'm not sure I can help with the commands. but please never ever perform backups on live databases, it is a source of data corruption. If you have filemaker server, use it's built-in scheduler to create regular backups safely. If you don't have Filemaker Server, close the database before performing the backup. Kjoe, Does this apply to the "Save as a copy" command? I have scripted this command to run everytime I close my file. Is the corruption on the copied file or the open file? John Coffey Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 14, 2008 Share Posted May 14, 2008 I'm pretty confident you can use this script step safely in single-user situations, however I do not know about networked solutions. I'm not sure I can answer the second question. At least the open file, but the corruption would / could be copied subsequently to the backup. Quote Link to comment Share on other sites More sharing options...
David Head Posted May 14, 2008 Share Posted May 14, 2008 I'm pretty confident you can use this script step safely in single-user situations, however I do not know about networked solutions. AFAIK, the Save A Copy As… command is safe to use in all cases where it is available. It is only available where the client is the host of the file. Therefore it is not available to any user accessing a database hosted by FileMaker Server or who is a guest in a peer-to-peer sharing situation. If the host in a peer-to-peer sharing situation performs the command, the copy created contains all committed data and schema changes. Having said all that, paranoia is a good thing. I would probably script the backup process to check for guests first and only proceed where there are no guests. Quote Link to comment Share on other sites More sharing options...
Jorgen Posted May 14, 2008 Author Share Posted May 14, 2008 smiley-laughingThanks all for the feedback!smiley-laughing Regards Jörgen p.s. Been working on a script and it works perfect with 4 file references Quote Link to comment Share on other sites More sharing options...
JR4506 Posted May 14, 2008 Share Posted May 14, 2008 I think with xcopy if the file name contains spaces you need to enclose the file name in quotes for it to work. JR Quote Link to comment Share on other sites More sharing options...
jcoffey Posted May 14, 2008 Share Posted May 14, 2008 My script uses the Set Variable($nameDate;Value:"name" & table::dateCalc). The dateCalc field is: Substitute(Get (CurrentDate);"/";".") which strips backslashes from the date, which Filemaker will not let you use, and substitutes periods. If I backed up more than once a day, I'd use a time stamp rather than Get (CurrentDate). Thanks for the help and answering questions. I'm kind of winging it and not always sure if there might be a problem with "my" way. John Coffey Quote Link to comment Share on other sites More sharing options...
LingoJango Posted May 15, 2008 Share Posted May 15, 2008 FWIW, I believe someone here once advised me to use Commit Records before any Save As script step. That's what I'm doing. Quote Link to comment Share on other sites More sharing options...
David Head Posted May 15, 2008 Share Posted May 15, 2008 FWIW, I believe someone here once advised me to use Commit Records before any Save As script step. That's what I'm doing. That is good advice: If the host in a peer-to-peer sharing situation performs the command, the copy created contains all committed data and schema changes. Quote Link to comment Share on other sites More sharing options...
Jorgen Posted May 15, 2008 Author Share Posted May 15, 2008 Hi There, JR: I tried the quotes but it didn't work. John Coffey: Anyway about creating the backup. I have 4 file references. In file 1 there's a script via a button. Save a copy of file 1 Open file 2 Close file 1 In file 2 is a startup script Save a copy of file 2 Open file 3 Close file 1 Same in file 3 & 4 When i use the command "Save a copy" i have no abbility to create a variabel name. This is a static. How do i create a backup name with a date and time in it? Thanks to you all for leraning me the tricks! Jörgen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.