Author |
|
doctorjerry Groupie
Joined: November 10 2007 Location: United States
Online Status: Offline Posts: 57
|
Posted: January 09 2008 at 18:18 | IP Logged
|
|
|
As a new Powerhome user and nonprogrammer, please explain every step for me to simply backup the database without closing down the program.
I found the following reference,which seems in the ballpark, but I have no idea where this command is executed. Is it a dos level command, or perfomed within powerhome. And if this is the command, I still need help with all the parenthesis'.
ph_backupdb ("C:\HA\PowerHome\Database\Backups\phdbbackup." + string (year (today ())) + string (month (today()), "00") + string (day (today()), "00") + ".db", 0)
Sincerely,
Jerome
__________________ Jerome
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: January 09 2008 at 20:41 | IP Logged
|
|
|
That is a formula that can be put into a macro to be executed automatically which will create backups with a file name that contains the year, month, and day it was run. It backs up up the database to the folder specified, which is C:\HA\PowerHome\Database\Backups. The last parameter, which is zero, means to not overwrite an existing file, if it exists.
A more simple version to just backup to a single file in the root of your c drive each time called would be...
ph_backupdb ("C:\phdb.db", 1)
Creating a macro with either of these is easy...
Launch the PowerHome Explorer (Maintenance, Explorer, or click the E icon in the PowerHome toolbar), navigate to the Macros section in the left pane, right-click in the right pane, select Insert, type in a macro a name (like backup), type in a Description (like backup database) and click Refresh (lightning bolt icon in the Explorer toolbar).
Now, find and click on this new macro in the left pane, move over to the right-pane, change the Command to Formula, make the Value Post, enter one of the formulas into the Send Keys box, then click refresh.
Now, when you want to backup the database, you can select the backup macro in the Macro/Formula drop-down and click Run.
|
Back to Top |
|
|
doctorjerry Groupie
Joined: November 10 2007 Location: United States
Online Status: Offline Posts: 57
|
Posted: January 10 2008 at 11:03 | IP Logged
|
|
|
Tony,
I created a macro in the macros window as follows
ID = BACKUP
Description = Database Backup
In the Macro Detail windows as follows
Command = Formula
Data = left blank
ID = left blank
Value = Post
Send Keys = ph_backupdb ("C:\phdb.db", 1)
Ran the macro but no file phdb.db is created in c:\
__________________ Jerome
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: January 10 2008 at 18:40 | IP Logged
|
|
|
I wrote a really short perl script that copies the backed up db file to a unique name, and call the script from SH as part of the backup macro. Then I created a control panel button that triggered the macro.
One click, and I get a unique backup.
just a thought
/j
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: January 10 2008 at 19:50 | IP Logged
|
|
|
Based on your saying it didn't work, I checked my c drive and I have no backups! I have been using this forever, but it looks like it stopped working about 1.5 years ago! I need to add some code to make sure the backup happens.
The formula evaluated to a 5 which means "the backup file rename operation fails".
If I change the path to be out of the root of C, it works.
Dave, does this make sense?
|
Back to Top |
|
|
ginigma Senior Member
Joined: June 18 2006 Location: United States
Online Status: Offline Posts: 127
|
Posted: January 10 2008 at 20:59 | IP Logged
|
|
|
Here's what I use in a timed event:
ph_backupdb ("C:\HA\PowerHome\Database\Backups\phdbbackup." + string (year (today ())) + string (month (today()), "00") + string (day (today()), "00") + ".db", 0)
__________________ Insteon (40 devices) ^ PowerHome (435 links) ^ Logitech Harmony 880
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: January 11 2008 at 05:46 | IP Logged
|
|
|
TonyNo wrote:
The formula evaluated to a 5 which means "the backup file rename operation fails".
If I change the path to be out of the root of C, it works. Dave, does this make sense? |
|
|
I have the same problem as TonyNo
Peter
|
Back to Top |
|
|
doctorjerry Groupie
Joined: November 10 2007 Location: United States
Online Status: Offline Posts: 57
|
Posted: January 11 2008 at 13:09 | IP Logged
|
|
|
Glad to see such interest in what I thought was a simple problem.
All suggested formulas worked as long as it's not c: drive.
Hope I don't have to learn Perl script to use the program, but if I do I'll get back to you Jeff.
If have other unrelated questions. Should I continue on this thread, or create a new one for each question?
Jerry
__________________ Jerome
|
Back to Top |
|
|
cmhardwick Senior Member
Joined: July 08 2006 Location: United States
Online Status: Offline Posts: 290
|
Posted: January 11 2008 at 13:33 | IP Logged
|
|
|
New threads, to keep it simple to track
__________________ Cicero, Enjoying automation!
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 15 2008 at 15:27 | IP Logged
|
|
|
Tony,
I know this used to work so it looks like it may be a bug that was introduced with the upgrade from ASA 6 to ASA 7. I'll check into it and make sure it gets squashed.
Dave.
|
Back to Top |
|
|