Giter Site home page Giter Site logo

Comments (1)

lodpp avatar lodpp commented on June 29, 2024

my workaround if it can help others.

I use an exec hook instead of githubrepo ( or even a cron that does the push every now and then)

The drawback is that it's a 2 step process to get this configuration to work.

1 - Start the daemon, it will initialized the git repository but will likely fail to push
2 - Stop the deamon
3 - Go to the backup directory
- git remote add origin $yourGit RepoURL
- check with git remote -v
- git push --set-upstream origin master
4 - To make sure you will have a push next time
- git-crypt unlock
- edit one file sonehow, it's just to make a diff
- git-crypt lock
- git add / git commit ( do not push )
5 - start the deamon again, it should backup the devices, find a diff then push

Dec 29 09:40:41  backupvmtest oxidized[25439]: D, [2023-12-29T09:40:41.757366 #25439] DEBUG -- : Exec: Execute: "cd /home/oxidized/network-configuration-backup && /usr/bin/git push"
Dec 29 09:40:42 backupvmtest oxidized[25773]: To mygitrepo.git
Dec 29 09:40:42 backupvmtest oxidized[25773]:    e062c37..c0293ec  master -> master

OR this if nothing has changed

Dec 29 09:53:48 backupvmtest oxidized[25802]: D, [2023-12-29T09:53:48.399061 #25802] DEBUG -- : Exec: Execute: "cd /home/oxidized/network-configuration-backup && /usr/bin/git push"
Dec 29 09:53:48 backupvmtest oxidized[26120]: Everything up-to-date
output:
  default: gitcrypt
  debug: true
  gitcrypt:
    user: me
    email: [email protected]
    repo: "/home/oxidized/network-configuration-backup"
    users:
      - "0xABCDEF" # a user
      - "0xGHIJKL" # another user
      - "0xMNOPQR" # someone else

hooks:
  push_to_remote:
    type: exec
    events: [post_store]
    cmd: cd /home/oxidized/network-configuration-backup && /usr/bin/git push

from oxidized.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.