Skip to content

How to add autobackup using obsidian git? #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ljudina opened this issue Jan 27, 2024 · 3 comments
Open

How to add autobackup using obsidian git? #354

ljudina opened this issue Jan 27, 2024 · 3 comments

Comments

@ljudina
Copy link

ljudina commented Jan 27, 2024

Hi,

I have installed Obsidian git plugin which automatically backups vaults one hour after file changed.
This only works when Obsidian application is active, but if I change vaults inside neovim it does not run backups.

Is there any way to trigger backup changes in neovim as well?

Sincerely,
Marko

@epwalsh
Copy link
Owner

epwalsh commented Jan 29, 2024

Hey @ljudina not at the moment. Personally I just have my own shortcut command that I call periodically to create commits via fugitive.

@NikolaM-Dev
Copy link

Owner

Could you share them please?

@stelcodes
Copy link

stelcodes commented Feb 29, 2024

@NikolaM-Dev Probably something like this I'd imagine:

mappings = {
  ['<c-s>'] = {
    action = function() vim.cmd 'Git commit -am "This is a routine Obsidian commit"' end,
    opts = { buffer = true }
  }
}

But if you want automation you'd be better off setting up an hourly service that runs outside of Neovim to make these commits, that way they will always run as long as your computer is on. On linux a systemd user service would be great for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants