automated net commit

  • 1
  • Question
  • Updated 5 months ago
Hi guys, I'm have a cuestion..

I'm working with Cumulus Linux, I do changes on my cumulus, and write changes using net commit ...
I would like do a "net commit " and exactly after, copy modifyed files to my backup folder


for example:

Cumulus_base ---> I'm do changes ---> git commit --> if it was ok = "copy modified files to /mnt/backup/ "


I think that it is posible using a crontab job, but I'm prefer execute exactly after
or I need write a (bash/python) script to do it... 

a) It is posible? 
b) cumulus have a service to do this ?
Photo of Jtan

Jtan

  • 70 Points

Posted 5 months ago

  • 1
Photo of Pete B

Pete B, Official Rep

  • 2,730 Points 2k badge 2x thumb
Hi Jtan, Cumulus Linux already uses snapper to create snapshots. And snapshots are automatically taken right before and after a net commit. I hope this helps!

https://docs.cumulusnetworks.com/display/DOCS/Using+Snapshots
Photo of Eric Pulvino

Eric Pulvino, Official Rep

  • 3,738 Points 3k badge 2x thumb
There is no process which ships in Cumulus Linux today which allows you to automatically run a command after a successful net commit. It would be possible to write a syslog parser to do something like this looking for the associated syslog messages informing a successful commit.

 sudo tail -n 1 /var/log/netd.log
2017-09-12T14:31:30.131832+00:00 leaf01 netd:    INFO:  RXed: user cumulus, command '/usr/bin/net commit'
Something looking for the message above. This option would be a bit more dynamic than using cron.