![]() This is not a particularly exciting example of automation, mainly because SuperDuper is so reliable. I decided a black dot was less obtrusive and more indicative of “normal” in the menubar. It now uses a black dot to indicate success instead of a green dot.It also, as before, sends a failure signal if SuperDuper’s log file indicates that the backup never finished. This is in keeping with how SuperDuper and sdsignal are scheduled. It now looks for the date on which the last SuperDuper backup was run and sends the failure signal if that date was not the day before sdsignal is run.If it'sĨ: # run on the day of a backup or more than one day after a backup, itĩ: # will indicate a failed backup even if the backup was successful.ġ2: abhost = '127.0.0.1' # localhost IP numberġ5: # Where the SuperDuper! log files are.ġ9: "Smart Update Backup from Macintosh HD.sdsp/Logs/")Ģ2: logfiles = 'sdlog']Ģ6: # Get yesterday's date in the format SuperDuper! uses in its log file.Ģ7: y = date.today() + timedelta(days=-1)Ģ8: ystr = y.strftime('%a, %b %-e, %Y') # %-e is the day of month w/o spaceģ0: # Look for the correct "Started on" line.ģ4: if ('| Info | Started on %s at' % ystr) in line:ģ8: # If the date is right, look for the "Copy complete" line.Ĥ3: if "| Info | Copy complete." in line:Ĥ7: # At this point, good is True if the log file has the right date andĥ0: # Send AnyBar the black or red signal depending on whether the backup worked.ĥ1: # AF_INET is for IPv4 and SOCK_DGRAM is for UDP.ĥ2: anybar = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) Here’s the new version: python:ħ: # This script is expected to be run on the day after a backup. In addition to changing how sdsignal is invoked, I’ve changed the way it works, too. LaunchControl wrote it for me after I filled in a couple of fields. While this is not a particularly complicated plist file, I can’t take credit for writing it. You need to create a separate entry for each day. You’d think the plist format would allow you to set day ranges, but no. There are no backups on Saturday or Sunday night, so there’s no need to run sdsignal on Sunday or Monday morning. These days were chosen because I have SuperDuper do its backup every weekday evening. The configuration file is set to run sdsignal at 5:56 AM on Tuesday through Saturday. It can also be loaded manually by running launchctl load ~/Library/LaunchAgents/ By saving it here, it gets loaded (but not necessarily run) whenever I log in. ![]() The automatic running of the signalling script, sdsignal, by launchd is configured through the plist file, which is saved in my ~/Library/LaunchAgents folder. Soma-zone has written a nice introduction to both launchctl and the whole launchd system. If you need to manage only one or two, you can probably get by with the command-line tool, launchctl, that Apple provides. So I changed things to have the script run independently of SuperDuper via launchd, OS X’s system for automatically running programs.īecause I use several Launch Agents, I popped for LaunchControl by soma-zone to manage them. If SuperDuper gets hung up at some point-which can happen-I have no guarantee that the signalling script will run. I decided this wasn’t the best way to go about it. Originally, I set one of SuperDuper’s advanced options to run a script upon completion that would set the signal image. ![]() As you may recall, the idea is to have an image in the menubar that tells me whether my most recent backup was successful or not. With those announcements out of the way, let’s talk about the changes I made to my AnyBar/SuperDuper setup. AnyBar is more flexible, but that flexibility comes with reduced simplicity. TextBar seems to have a simpler user interface, especially when you want to display more than one signal in your menubar, but it’s meant to be used only for signals that are updated regularly. It doesn’t display graphics, but with Emoji and the rest of Unicode, I doubt that’s a significant limitation. Unbeknownst to all of us, though, was TextBar a $3 app from Rich Somerfield that already does what T.J. ![]() But Brett’s slowing down-it wasn’t ready until the following morning. When I saw T.J.’s tweet, I thought Brett would have a solution before the end of the day. He knew that acting helpless within earshot would have Brett leaping to his rescue. Luoma, Brett Terpstra has made a fork of AnyBar that allows text to be displayed in the menubar in addition to or instead of the little graphics that Nikita Prokopov’s original is limited to. First, in response to a question/request by T.J. I think the new system is more robust than my first stab at it.īut before I get to that, I want to mention a couple of other menubar-related items. If you’ve been reading this blog for any length of time, you won’t be surprised to hear that I’ve made some changes to the AnyBar/SuperDuper setup I talked about a couple of days ago. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |