Coder Social home page Coder Social logo

syncoid-replicate.sh's Introduction

Syncoid Replication Script

Introduction

The "syncoid-replicate.sh" script is a Bash script designed for replicating ZFS datasets using the syncoid tool. It is especially useful for tasks like replicating virtual machine (VM) disks between different ZFS pools, such as from an SSD pool to a mirrored hard drive pool. This script is intended to simplify and automate the replication process.

Prerequisites

Before using this script, ensure the following prerequisites are met:

  1. A working ZFS setup with both the source and destination datasets properly configured.
  2. The syncoid tool should be installed and accessible. You can install it from the syncoid GitHub repository.
  3. Appropriate permissions to run the script and access the ZFS pools.

Usage

To use the "syncoid-replicate.sh" script, follow these steps:

  1. Download the script to your system.
    wget https://raw.githubusercontent.com/Mikesco3/syncoid-replicate.sh/main/syncoid-replicate.sh
  2. Make the script executable using the following command:
    chmod +x syncoid-replicate.sh
  3. Run the script with the source and destination ZFS datasets as arguments. For example, to replicate a dataset from "fast200" to "local-zfs", use the following command:
./syncoid-replicate.sh fast200/vm-vdisk-0 rpool/vm-shadow-of-vdisk-0

Replace fast200/vm-vdiak with your source and destination datasets.

  1. The script will use syncoid to replicate the dataset, and you will be notified of the replication status (success or failure).

Scheduling Replication

To automate dataset replication, consider using a tool like cron to schedule the script to run at specific intervals. For example, to run the script daily, you can add a cron job:

  1. Open your crontab for editing:
crontab -e
  1. Add a line to schedule the script, providing the full path to the script and the desired schedule. For example, to run the script daily at midnight:
0 0 * * * (/path/to/syncoid-replicate.sh fast200/vm-vmname rpool/vm-vmname) > /dev/null

Running the (command) > /dev/null supresses regular output and only produces output if there are any error messages Save the file.

Troubleshooting

  • If you encounter issues with the script, check for errors in the script output and logs.
  • Ensure that the required permissions and paths are correctly configured.
  • Verify that the syncoid tool is installed and properly configured.

Disclaimer

This script is provided as-is and without warranty. Use it at your own discretion and ensure that it aligns with your specific requirements and system setup.

License

AGPL-3.0 license.

syncoid-replicate.sh's People

Contributors

mikesco3 avatar

Stargazers

 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.