This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will simulate an infinite backup cycle per day. | |
# Empty backup files are created in the current working directory | |
# and deleted acording to the cleanup algorithm parameters. | |
# One file per second is created, which is one simulated day. | |
# => It is best to run this script form inside an empty test directory. | |
# This script will not halt and must be aborted! | |
# The same algorithm is used in https://github.com/bit-team/backintime | |
set -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: ./backup.sh btrfs_root_path | |
# requirements: | |
# 1. $BACKUP_DIR must not exist in the btrfs_root_path | |
# 2. current, new, top, old must not exist in the btrfs_root_path | |
# how it works: | |
# The script creates a single btrfs snapshot "new" per invocation and btrfs sends it | |
# to the $BACKUP_DIR with a "current" snapshot as parent. | |
# Thus the btrfs send is incremental with either an initial "current" snapshot | |
# or a "current" snapshot from the previous invocation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
py_script=' | |
import mmap, base64, sys, getopt | |
def main(argv): | |
inputfile = "" | |
needle = b"" | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
py_script=' | |
import mmap, base64, sys, getopt | |
def main(argv): | |
inputfile = "" | |
needle = b"" | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
py_script=' | |
import mmap, base64, sys, getopt | |
def main(argv): | |
needle = b"" | |
try: | |
opts, args = getopt.getopt(argv,"hn:",["needle="]) |