Auto-Save

If you have a feature you'd like to see in Indigo, post it here. Others can refine the idea if they like. Please keep each topic to one feature or a closely related set of features and don't add other unrelated requests to an existing topic. Use the Hardware Support Requests forum below to request support for some bit of hardware - but be sure to check the 3rd Party Plugins Forum first though to make sure there isn't already a plugin for it.
makedrinklas
Posts: 126
Joined: Tue Oct 12, 2004 11:29 am

Auto-Save

Post by makedrinklas »

Hi!
It would be useful to have an automatic backup system in place for the database with save iterations to a specific different location, such as iCloud or an external drive.

This might be helpful for people who frequently tweak their setups.

I do this manually, but it could be good to have them auto-created at intervals, daily, every 15 minutes while working, etc.

Maybe at some point be able to preview the database and pick out the command(s) you'd like to restore. Sort of like the Save As function maybe even to export individual commands/devices to import back into the newer database. Like a fakey undo work-around.

Lastly, since folders allow drag and drop, it could also be useful to use folders in devices, triggers, actions and run commands on the entire contents. (Enable all, etc.)
ryanbuckner
Posts: 1108
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Auto-Save

Post by ryanbuckner »

FWIW - I have been using this script to backup Indigo once a month on a schedule. It obv doesn't do the other things on your wish list, but it's a start

Code: Select all

import distutils
import distutils.archive_util
import zipfile
import time

path = "/Users/ryanbuckner/Documents/Indigo Backups"  #Change this to your desired path
number_of_days = 10  #Change this to the number of days you want to keep backups

def remove(path):
    if os.path.isdir(path):
        try:
            indigo.server.log(" - removing folder %s" % path)
            os.rmdir(path)
        except OSError:
            indigo.server.log( " - unable to remove folder: %s" % path)
    else:
        try:
            if os.path.exists(path):
                indigo.server.log(" - removing file %s" % path)
                os.remove(path)
        except OSError:
            indigo.server.log( " - unable to remove file: %s" % path)

indigo.server.log ("Starting backup; saving to %s" % path )
time_in_secs = time.time() - (number_of_days * 24 * 60 * 60)
for root, dirs, files in os.walk(path, topdown=False):
    for file_ in files:
        full_path = os.path.join(root, file_)
        stat = os.stat(full_path)
        if stat.st_mtime <= time_in_secs:
            remove(full_path)
    if not os.listdir(root):
        remove(root)

archive_filename_template  = "Indigo_Backup_%m_%d_%Y__%H_%M_%S"
archive_filename =  os.path.expanduser ( path + os.sep + time.strftime ( archive_filename_template, time.localtime() ) )
indigo.server.log (" - archive filename %s" % archive_filename + ".zip")
indigo.server.log (" - save path %s" % indigo.server.getInstallFolderPath() )

try:
    distutils.archive_util.make_zipfile ( archive_filename, os.path.expanduser ( indigo.server.getInstallFolderPath()) )
except zipfile.LargeZipFile:
    indigo.server.log ("Zip file too big.  Would require 64 bit extensions")
   
indigo.server.log ("Backup Finished.")
makedrinklas
Posts: 126
Joined: Tue Oct 12, 2004 11:29 am

Re: Auto-Save

Post by makedrinklas »

That is awesome, thanks!
User avatar
jay (support)
Site Admin
Posts: 18416
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Auto-Save

Post by jay (support) »

Indigo does auto-saves. If you have Time Machine configured to back up the Indigo installation folder, then you automatically have checkpointed database backups via Time Machine. To revert, shut down the Indigo Server, open the databases folder in the install directory in the Finder, then use the Time Machine interface to restore an older version of the database file. Restart the server and you've successfully reverted to a prior version.

This is also the best way to back up your complete Indigo install.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Post Reply

Return to “Feature Requests”