OPNsense Forum

English Forums => General Discussion => Topic started by: zone42 on October 09, 2019, 07:58:21 am

Title: Config backup to remote git repo
Post by: zone42 on October 09, 2019, 07:58:21 am
The manual describes how to backup the config to GDrive or Nextcloud.

We would prefer a remote git repository for this to save the config history and be able to easy rollback to an earlier setup.

Is this possible?
Title: Re: Config backup to remote git repo
Post by: ownerer on January 23, 2020, 03:19:14 pm
I got here looking for the same thing!
Did you ever get any kind of reply to this question?
Title: Re: Config backup to remote git repo
Post by: zone42 on January 24, 2020, 05:27:25 am
Unfortunately not yet.  :(
Title: Re: Config backup to remote git repo
Post by: AdSchellevis on January 24, 2020, 09:17:05 am
We don't have plans to wrap this into a plugin ourselves, but you can easily check /conf into git and use a cronjob to commit when the contents change. (exclude the backup directory in yout .gitignore if you don't want to spam duplicates, config.xml is usually the only thing you need).

If you want to trap all changes (not on a time interval), it might need more design since you want to prevent locking actual writes, in theory you should be able to use /conf/backup for this purpose and script the commits in sequence of how the appeared (copy backup file to a staging directory, git add, git commit, next file,...)

Best regards,

Ad