Git Product home page Git Product logo

pbs-client-container's Introduction

Proxmox Backup Client in Container Image

Container Image CI

This image contains the Proxmox Backup Client for unsupported platforms.

Usage

  1. Mount the desired backup directory to the container
  2. Define the settings via environment variables according to the manual
  3. Run the backup command in the cntainer

Example

I use ansible to create a podman container, mount the directory to back up inside. Then I turn the container into a systemd service, and create a timer to back up accordingly.

I also enabled podman-auto-update. In this setup, podman-auto-update doesn't work, since it only updates running containers, and all these contaienrs don't run constantly.

---
- name: Ensure PBS client
  hosts: all
  become: true

  tasks:
    - name: Ensure pbs-client container
      containers.podman.podman_container:
        name: pbs-clien
        image: docker.io/zoenglinghou/pbs-client-container
        volumes:
          - "/data:/data:ro"
        env:
          PBS_REPOSITORY: ""
          PBS_PASSWORD: ""
          PBS_ENCRYPTION_PASSWORD: ""
          PBS_FINGERPRINT: ""
        label: io.containers.autoupdate=registry
        restart_policy: "no"
        command: proxmox-backup-client backup data.pxar:data --backup-id {{ inventory_hostname }}.data
        state: created

    - name: Generate systemd unit files
      containers.podman.podman_generate_systemd:
        name: pbs-client
        new: true
        dest: "/etc/systemd/system"

    - name: Ensure container timer
      ansible.builtin.copy:
        dest: /etc/systemd/system/container-pbs-client.timer
        mode: "0644"
        content: |
          [Unit]
          Description=Backup to pbs everyday at 10:30am

          [Timer]
          OnCalendar=*-*-* 10:30:00
          RandomizedDelaySec=1800

          [Install]
          WantedBy=timers.target

    - name: Enable container timer
      ansible.builtin.systemd:
        name: pod-pbs-client.timer
        daemon_reload: true
        state: started
        enabled: true

pbs-client-container's People

Contributors

zoenglinghou avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.