commands before/after succesfull completion #17

Closed
opened 2018-01-05 05:33:46 +00:00 by import_bot · 7 comments
Collaborator

It would be nice to be able to execute some script before and after the backup
like getting contacts from dav-server, ...


Imported from Taiga issue 16 (done). Created on 2015-12-19T11:40:01+0000 by stunkymonkey.

It would be nice to be able to execute some script before and after the backup like getting contacts from dav-server, ... --- Imported from Taiga issue 16 (done). Created on 2015-12-19T11:40:01+0000 by stunkymonkey.
Author
Collaborator

in my case:
every time i make an backup i wrote the time to a file.
i also got an cron task which checks when the last backup was and makes a notify-send if my backup is older then one week.
so this would be pretty usefull


Comment on 2015-12-20T22:06:19+0000 by stunkymonkey.

in my case: every time i make an backup i wrote the time to a file. i also got an cron task which checks when the last backup was and makes a notify-send if my backup is older then one week. so this would be pretty usefull --- Comment on 2015-12-20T22:06:19+0000 by stunkymonkey.
Author
Collaborator

If you're invoking atticmatic with cron, then I think you would be able to accomplish what you're talking about directly in your crontab. For instance, if your cron entry looks something like this today...

0 3 * * * root /usr/local/bin/atticmatic

.. then you might be able to just add something like this to do some action after the backup succeeds:

0 3 * * * root /usr/local/bin/atticmatic && touch somefile.txt

Similar idea if you want to run some command before the backup begins:

0 3 * * * root get-contacts-from-caldav-server && /usr/local/bin/atticmatic

Does that work for your use cases?


Comment on 2015-12-20T23:27:47+0000 by Dan Helfman.

If you're invoking atticmatic with cron, then I think you would be able to accomplish what you're talking about directly in your crontab. For instance, if your cron entry looks something like this today... ``` 0 3 * * * root /usr/local/bin/atticmatic ``` .. then you might be able to just add something like this to do some action after the backup succeeds: ``` 0 3 * * * root /usr/local/bin/atticmatic && touch somefile.txt ``` Similar idea if you want to run some command before the backup begins: ``` 0 3 * * * root get-contacts-from-caldav-server && /usr/local/bin/atticmatic ``` Does that work for your use cases? --- Comment on 2015-12-20T23:27:47+0000 by Dan Helfman.
Author
Collaborator

at the moment this is my solution.
I just wondered if you plan to support it in any way


Comment on 2015-12-21T13:21:04+0000 by stunkymonkey.

at the moment this is my solution. I just wondered if you plan to support it in any way --- Comment on 2015-12-21T13:21:04+0000 by stunkymonkey.
Author
Collaborator

That seems like a reasonable feature to add. I just wanted to make sure you had a work-around in the meantime. Thanks for the suggestion!


Comment on 2015-12-24T03:57:19+0000 by Dan Helfman.

That seems like a reasonable feature to add. I just wanted to make sure you had a work-around in the meantime. Thanks for the suggestion! --- Comment on 2015-12-24T03:57:19+0000 by Dan Helfman.
Author
Collaborator

+1 For this features.


Comment on 2016-07-03T10:03:52+0000 by s200999900.

+1 For this features. --- Comment on 2016-07-03T10:03:52+0000 by s200999900.
Author
Collaborator

I am using systemd to run borgmatic, and just realized that the lock.exclusive folder was left behind from a previous failed backup, and this prevented future backups from running. I had mistakenly assumed that my backups were being taken, but until checking manually, I discovered the opposite. It would be great to have borgmatic send an e-mail, or at the least, write to a logfile. +1 for this feature big time. Thanks for borgmatic regardless!


Comment on 2016-10-18T03:31:34+0000 by George Merlocco.

I am using systemd to run borgmatic, and just realized that the lock.exclusive folder was left behind from a previous failed backup, and this prevented future backups from running. I had mistakenly assumed that my backups were being taken, but until checking manually, I discovered the opposite. It would be great to have borgmatic send an e-mail, or at the least, write to a logfile. +1 for this feature big time. Thanks for borgmatic regardless! --- Comment on 2016-10-18T03:31:34+0000 by George Merlocco.
Author
Collaborator

This has been implemented! Check out borgmatic 1.1.9, just released. There's a new "hooks" section in the configuration file.. Generate a sample file to check it out.


Comment on 2017-10-30T03:35:20+0000 by Dan Helfman.

This has been implemented! Check out borgmatic 1.1.9, just released. There's a new "hooks" section in the configuration file.. Generate a sample file to check it out. --- Comment on 2017-10-30T03:35:20+0000 by Dan Helfman.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#17
No description provided.