Automatic Backup each day to a new location

Top  Previous  Next

 

We're often asked if the automatic backup can be made to some location other than the database folder.  The standard auto-backup can't be changed, but you can add a 2nd auto-backup function through Advanced Customizations.  It's a very simple customization, which is why we haven't bothered to add a specific option for it in the standard program.

 

Disclaimer: As with all Advanced Customizations, this is programming and must be done precisely or the results can be unpredictable.  Normal support does not include help with getting Advanced Customizations to work beyond what is in this article and the system documentation.

 

 

1. To add this feature, go to Maintenance / Advanced Customizations / Event Actions.

 

2. Click Add Event Action.

 

3. Enter an Action Name, like "Backup each day".

 

4. For the Event Trigger, select "Each Hour".

 

5. For the Condition, enter the following (all in one line -- if this shows it as multiple lines, enter it continuously without pressing Enter).  

 

Hour(DateTime()) = 5 AND Workstation() = 0

 

Note: Spacing is critical, it must be typed EXACTLY as shown, for instance with spaces on each side of the AND's and the operators (=), but no spaces anywhere else.

 

This will make it back up each day at 5AM -- change the value if you prefer a different time (from 0, which is midnight, to 23, which is 11PM).  It also sets it to only back up Workstation 0.  This keeps it from happening on all computers at once if you have networked computers.

 

6. For the Action expression, enter:

 

BackupDatabase("C:\\CM Backup " + FormatDateTime("%Y-%m-%d", Today()) + ".zip")

 

This will put it on the root of C:, with the file name including the date, formatted as "CM Backup YYYY-MM-DD.zip"  If you need it a different location, you can enter the path accordingly -- but don't forget to double up the backslashes in the path as shown (a text formatting requirement as described in the documentation).

 

You can change the path to put it anywhere you want.  For instance you can have it back up to your DropBox account by using the Dropbox folder (so the Dropbox synchronization will upload it automatically).  To find out what your Dropbox folder is, you need to check your Dropbox settings.  This may help:

https://www.dropbox.com/help/desktop-web/locate-dropbox-folder

 

Again, don't forget to double up the backslashes in the path (e.g.  "C:\\users\\dropbox\\" instead of just "c:\users\dropbox\")

 

 

7. Click Save, then Close to exit Event Actions Setup.

 

Note that this event is only checked each hour, and only after all dialogs are closed.  So it will happen the first time dialogs are closed between 5AM and 5:59AM.

 


Page URL http://CampgroundMaster.com/help/automaticbackupeachday.html

Campground Master Home