vitor Posted August 28, 2023 Posted August 28, 2023 Usage Generate a backup of your local Alfred Preferences via the start backup keyword. A macOS launchd agent will be loaded to do it daily at the time set in the Workflow’s Configuration (using the 24-hour clock format). The number of versions to keep is likewise configurable. Restore a previous version with the restore backup keyword. It takes a few seconds to complete and restarts Alfred. ⤓ Install on the Alfred Gallery | Source andy4222, Floating.Point and JJJJ 3
vitor Posted August 28, 2023 Author Posted August 28, 2023 How to Report Issues Accurate and thorough information is crucial for a proper diagnosis. At a minimum, your report should include:The debugger output of the failing action.Your installed versions of: the Workflow, Alfred, and macOS. Be precise, don’t say “latest”.More information is always welcome. A short video of the steps with the debugger open may help to identify the problem faster.
vitor Posted September 19, 2023 Author Posted September 19, 2023 Updated to 2023.3.Updated icon.Make restore result invalid when there are no backups found.
mikedvzo Posted April 18, 2024 Posted April 18, 2024 (edited) Can an interval be added for the number of days? I prefer to back up weekly or every x number of days and nights every day since my preference file is 400MB each on both my Macs, and I am backing up to iCloud. Edited April 18, 2024 by mikedvzo wording
vitor Posted April 18, 2024 Author Posted April 18, 2024 That would add a bit of complexity and I worry might lead to foot guns. macOS launchd agents don’t run if your computer is turned off, so I’d hate for someone to not have a backup at a crucial time because the last one happened to be at an unlucky time and then the one they have is two weeks old or more. That’s why a time can be configured. The versioning is a secondary concern, the focus of the workflow is the backup. You could instead reduce the number of backed up versions. If by any reason you need an older version at some point, the last 30 days of them should be available to recover.
mikedvzo Posted April 20, 2024 Posted April 20, 2024 (edited) Ok I just thought it would be an option to chose daily or weekly for people who never turn their Macs off. Not that big of a deal will leave it daily Edited April 20, 2024 by mikedvzo
spongeblink Posted June 9, 2024 Posted June 9, 2024 New to me that you can restart Alfred while a workflow is running… I wonder if /usr/bin/osascript -l JavaScript -e 'Application("com.runningwithcrayons.Alfred").quit()' and /usr/bin/osascript -l JavaScript -e 'Application("com.runningwithcrayons.Alfred").activate()' is recommend if you want to restart Alfred if something weird is going on and you know restarting will probably fix it.
vitor Posted June 9, 2024 Author Posted June 9, 2024 I recommend against that. When something weird is going on, you want to reset things in the simplest, most manual way possible. You do not want to risk a strange restart not clearing whatever you’re seeing. Though I never in a decade had to restart Alfred due to something weird.
spongeblink Posted June 10, 2024 Posted June 10, 2024 9 hours ago, vitor said: When something weird is going on, you want to reset things in the simplest, most manual way possible Got it. 9 hours ago, vitor said: Though I never in a decade had to restart Alfred due to something weird. Happened several times to me this year when files or apps won't show in Alfred's default result, but a restart fixed it.
vitor Posted July 7, 2024 Author Posted July 7, 2024 Updated to 2024.1.Use Universal Action to trash old backups.Skip Input as Universal Action.Shorter Objective-C functions.
mikedvzo Posted July 10, 2024 Posted July 10, 2024 How do you change the number of backups after the script is installed? I see the default value in the script, but I'm not sure where it is reading the value that I entered during install.
mikedvzo Posted July 10, 2024 Posted July 10, 2024 On 4/18/2024 at 12:22 PM, vitor said: That would add a bit of complexity and I worry might lead to foot guns. macOS launchd agents don’t run if your computer is turned off, so I’d hate for someone to not have a backup at a crucial time because the last one happened to be at an unlucky time and then the one they have is two weeks old or more. That’s why a time can be configured. The versioning is a secondary concern, the focus of the workflow is the backup. You could instead reduce the number of backed up versions. If by any reason you need an older version at some point, the last 30 days of them should be available to recover. I thought about this more and I am trying to modify your workflow to add the Weekday argument to the LaunchAgent PLIST. From a backup perspective running a backup daily and keeping 8 copies is more unreliable than running it weekly and keeping 8 copies. If the file is corrupt you overwrite the old backups and be left with 8 corrupted versions.
vitor Posted July 10, 2024 Author Posted July 10, 2024 16 hours ago, mikedvzo said: How do you change the number of backups Change it in the Workflow’s Configuration. It’ll take the next time a backup fires. 16 hours ago, mikedvzo said: I am trying to modify your workflow to add the Weekday argument to the LaunchAgent PLIST. I recommend launchd.info for learning more. 16 hours ago, mikedvzo said: From a backup perspective running a backup daily and keeping 8 copies is more unreliable than running it weekly and keeping 8 copies. A weekly backup may not catch the changes you need if you need the backup in an emergency (e.g. disk failure). 16 hours ago, mikedvzo said: If the file is corrupt you overwrite the old backups and be left with 8 corrupted versions. Alfred Preferences is a folder (a bundle) not a single file. And backups are never overwritten, they are trashed, so you can recover them from there or iCloud, as pointed out above.
Archetyped Posted September 14, 2024 Posted September 14, 2024 Can this workflow be updated to work with a non-default preferences location? It looks like the workflow checks for the actual preferences location, but stops if it doesn't match the default path. Is there a reason why a custom preferences location cannot be gzipped and saved like default location is?
vitor Posted September 14, 2024 Author Posted September 14, 2024 If you use a custom location, you can set it to a path that syncs and does its own management of versioning. And that could interfere with the backup by e.g. ejecting files and making them unavailable offline. The workflow very deliberately only works with the default location because that’s the only way it can guarantee a correct backup.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now