Coder Social home page Coder Social logo

zfs_backup's Introduction

For Python 3.7 or above

  • you need to install pyyaml: pip3 install pyyaml
  • first backup will be full snapshot and afterwards it will be incremental snapshot only
  • config file is hardcoded at /etc/zfs_backup_config.yml
config:
    pools:
        - "data/home"
        - "data/storage/application"
        - "data/storage/downloads"
        - "data/storage/kids"
        - "data/storage/music"
        - "data/storage/photo"
        - "data/storage/video"
        - "data/template"
    remote_address: "[email protected] -i identity_file"
    keep: 10
    shutdown: 1

remote_address remote backup host or fqdn must include identification file key using -i

keep means number of snapshot will be retended.

shutdown is to shutdown backup destination server or not

make sure to give execute permission to /usr/local/bin/zfs_backup.py chmod +x /usr/local/bin/zfs_backup.py

Remote Destination Pool must have the same structure like the Source Pool

Create a cron job to run zfs_backup.py on daily basis and you are all set, e.g. runs on everyday 2am

0 2 * * *       /usr/local/bin/zfs_backup.py

For PVE after backup hook script you can edit /etc/pve/vzdump.cron and use the --script to execute

0 0 * * 1,3,5       root vzdump 100 101 102 103 104 105 106 108 109 111 114 115 118 253 --quiet 1 --storage pbs --mailnotification failure --mode snapshot --script /usr/local/bin/zfs_backup.py

Please Note,if you edit the backup job in PVE Web GUI, --script will be removed and you must add to the cron again

zfs_backup's People

Contributors

elurex 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.