         NSApp.activate(ignoringOtherApps: true)
         NSApp.orderFrontStandardAboutPanel(sender)
     }
+    
+    func scheduleNextUpdate() {
+        // Update every hour at X:30
+        guard let cal = NSCalendar(calendarIdentifier: .gregorian) else {
+            print("Got nil calendar")
+            return
+        }
+        let now = Date()
+        let nowComps = cal.components([.hour, .minute], from: now)
+        let scheduledMinute = 30
+        // If we're under 1 minute of the scheduled time, use the current hour. Otherwise use the next hour
+        let hour: Int
+        if nowComps.minute! < (scheduledMinute - 1) {
+            hour = nowComps.hour!
+        } else {
+            hour = nowComps.hour! + 1
+        }
+        guard let scheduledDate = cal.date(bySettingHour: hour, minute: scheduledMinute, second: 0, of: now) else {
+            print("Got nil date")
+            return
+        }
+        
+        nextScheduledUpdate = scheduledDate
+        
+        let timerBlock = {(timer: Timer) in
+            self.update()
+            self.scheduleNextUpdate()
+        }
+        if scheduleTimer != nil {
+            scheduleTimer.invalidate()
+        }
+        scheduleTimer = Timer(fire: scheduledDate, interval: 0, repeats: false, block: timerBlock)
+        RunLoop.current.add(scheduleTimer, forMode: RunLoopMode.defaultRunLoopMode)
+        
+        updateLastUpdatedItemToolTip()
+    }
 }

    let fmt = DateFormatter()
    let backupsManager = BackupsManager()
    var prefsController: PreferencesController!
    
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        statusItem = NSStatusBar.system().statusItem(withLength: NSVariableStatusItemLength)

            menu.addItem(NSMenuItem.separator())
        }

        lastUpdatedItem = NSMenuItem(title: String(format: NSLocalizedString("Updated: %@", comment: ""), fmt.string(from: Date())), action: nil, keyEquivalent: "")
        updateLastUpdatedItemToolTip()
        let updateItem = NSMenuItem(title: NSLocalizedString("Update Now", comment: ""), action: #selector(update), keyEquivalent: "")
        updateItem.target = self
        menu.addItem(lastUpdatedItem)
