lra / mackup

Keep your application settings in sync (OS X/Linux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Option to run bash scripts before backup start (hooks)

castus opened this issue · comments

I've a feature request for you. Sometimes I need to do some stuff before backup my mac and it'll be really great if you can implement possibility to run bash scripts before and potentially after backup process. Error in scripts should break backup process.

Could be something like:

[application]
name = MyApp

[hook_before]
.config/run_before.sh

[hook_after]
.config/run_after.sh

What do you think?

I think this complicates what mackup is intended to do. Mackup is meant to be a simple dotfile backup script and nothing else.

Could you provide a more specific example? I'd want to understand your needs before dismissing the idea.

Why don't you make a bash script calling mackup instead?

@lra I've done exactly what you proposed already ;)
@joshmedeski I'll try to describe what was my thinking process and maybe it will help you. Mackup is for me a tool to backup my mac. Symlinking is only implementation detail of the whole backup process. That's why I think about mackup more broader than only symlinking. Based on that, hooks would be a nice addition.
But, I totally understand it now. You'd like to make the mackup as simple as possible. Everything more broader must be done by me.

I was looking for this as well. I'm using a tool called shortcuts which create/ingest a file, so basically "pre backup" and "post restore" hooks would be welcomed. I'd do something like:

[application]
name = rodionovd/shortcuts

[configuration_files]
.shortcuts.plist

[hooks]
before_backup = "shortcuts read --as-plist > ~/.shortcuts.plist"
after_restore = "shortcuts import ~/.shortcuts.plist"

Having a script to call mackup and execute stuff kinda defeats the "it just syncs™️ " imho.