Incorporate changes for version 1.3.2

This commit is contained in:
2026-02-25 17:16:15 -05:00
parent d59afa0196
commit 6a0733bd65
10 changed files with 1403 additions and 223 deletions

8
dist/etc/cron.daily/ribs_backups vendored Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
log_path="/var/log/ribs"
log_fn="ribs_$(date +%Y%m%d%H%M%S).log"
/usr/local/bin/ribs > "$log_path"/"$log_fn" 2>&1

View File

@@ -0,0 +1,116 @@
# ribs.conf.sample
# Configuration file for Rod's Incremental Backup System
#
# A configuration file should be created in either the system
# config directory (/etc/ribs/conf-available) or the user's
# config directory (~/.ribs/conf-available). The filename must
# have the .conf suffix. Use the ribs command to enable or disable
# the config file with the -e|--enable or -d|--disable options.
# Run ribs -h for help.
[General]
# General Options
#
# At least source_dir, backup_root, day_limit, and storage_type
# are required.
#
# Source directory - The directory where files to be backed up are
# located. This must be an absolute, not a relative path. If the
# trailing slash is included, the contents of the directory will be
# backed up. If not, the directory itself will be backed up.
# NOTE: Special characters must be escaped with backslashes!
#
source_dir=/var/www/
#
# Backup root directory - The directory on the backup storage where the
# backups are stored. For offline storage, this is the mount point of
# the backup drive filesystem. For remote storage, this is the path on
# the remote server. Must be writable to user running ribs. This must
# be an absolute, not a relative path. Directories named as the date
# of the backups will be created here containing the backed up files.
# NOTE: Special characters must be escaped with backslashes!
#
backup_root=/mnt/incremental_backup_dir
#
# Backup subdirectory - A subdirectory of backup_root in which to store
# the backup date directories. If this is not set, the date
# directories will be created directly in backup_root.
# NOTE: Special characters must be escaped with backslashes!
#
#backup_subdir=/main
#
# Exclude list - List of file patterns to exclude, separated by
# commas. Anything in the source directory that matches a pattern in
# this list will not be backed up. If you don't want to exclude
# anything from the backup, comment this option out with a '#'.
# NOTE: Special characters must be escaped with backslashes unless
# they represent a wildcard in a pattern!
#
#exclude_list=DatabaseBackups-*, somehugedir, secretstuff
#
# Day limit - The number of days of backups to keep. When the backup is
# complete, directories with dates older than this limit will be
# deleted.
#
day_limit=90
#
# Storage type - Where the backups are to be stored. Only one of the
# three options should be specified. Set the option you want, then
# refer to the appropriate section below for that specific
# configuration. Possible values are:
# local - Back up to a local directory. Can also be anything already
# mounted on the local filesystem.
# offline - Back up to offline storage that must be mounted. Can be
# anything that you can mount and unmount, including a filesystem
# on a local block device or a remote NFS or CIFS/SMB share.
# remote - Back up to a remote system directly via rsync. If you use
# this, you must define remote_user_host below and setup pubkey
# authentication vi ssh for the remote user and host.
#
storage_type=remote
#
[local]
# Options for local storage type
#
# There are currently no specific settings for the local storage type.
#
[offline]
# Options for offline storage type
#
# Options in this section are required if storage_type above is set
# to offline. Otherwise, they are ignored.
#
# Mount parameters - Storage filesystem mount parameters. Should be what
# you'd type on the command line between the word "mount" and the
# mountpoint. See the manual page for the mount command (man 8 mount)
# for the available options.
#
mount_parameters=-t ext4 -U 433a2e61-25aa-4da5-a7c7-4d730a5793e7
#mount_parameters="-t nfs nfsserver:/srv/ribs-backups"
#mount_parameters="/dev/sdc1"
#
# Remount read-only - Set this to True if storage should be remounted in
# read-only mode when not being used for backups, False if not.
#
remount_ro=True
#
[remote]
# Options for remote storage type
#
# Options in this section are required if storage_type above is set
# to remote. Otherwise, they are ignored.
#
# Remote user and host - The user and host to connect to for backup
# storage. If you want RIBS to be able to run unattended, for example
# as a cron job, you will need to ensure that the user's ssh public
# key is listed in the remote host's authorized_keys file. This is
# usually done with the ssh-copy-id command, which also takes care of
# adding the host's key fingerprint to the local known_hosts file.
#
remote_user_host=user@backupserver
#

View File

@@ -0,0 +1,124 @@
# Configuration file for Rod's Incremental Backup System
# Version 1.3.2
# ************************** General Options ***************************
#
# All of the options in the genera options section must be defined.
#
# ********************
# Dry run - Set to false for normal mode or true for testing.
#
DRY_RUN=true
#
# ********************
# Source directory - The directory where files to be backed up are
# located. This must be an absolute, not a relative path. If the
# trailing slash is included, the contents of the directory will be
# backed up. If not, the directory itself will be backed up.
# NOTE: Special characters must be escaped with backslashes!
#
SRC="/var/www/"
#
# ********************
# Backup root directory - The directory on the backup storage where the
# backups are stored. For OFFLINE storage, this is the mount point of
# the backup drive filesystem. For REMOTE storage, this is the path on
# the remote server. Must be writable to user running ribs. This must
# be an absolute, not a relative path. Directories named as the date
# of the backups will be created here containing the backed up files.
# NOTE: Special characters must be escaped with backslashes!
#
BACKUP_ROOT="/mnt/incremental_backup_dir"
#
# ********************
# Backup subdirectory - A subdirectory of BACKUP_ROOT in which to store
# the backup date directories. To just put the date directories
# directly in BACKUP_ROOT, set this to blank ("").
# NOTE: Special characters must be escaped with backslashes!
#
BACKUP_SUBDIR=""
#BACKUP_SUBDIR="/main"
#
# ********************
# Exclude list - List of file patterns to exclude, separated by
# newlines. Anything in the source directory that matches a pattern in
# this list will not be backed up. If you don't want to exclude
# anything from the backup, set this to blank ("").
# NOTE: Special characters must be escaped with backslashes unless
# they represent a wildcard in a pattern!
#
EXCLUDE_LIST=""
#EXCLUDE_LIST="
#DatabaseBackups-*
#somehugedir
#secretstuff
#"
#
# ********************
# Day limit - The number of days of backups to keep. When the backup is
# complete, directories with dates older than this limit will be
# deleted.
#
DAY_LMT=90
#
# ********************
# Storage type - Where the backups are to be stored. Only one of the
# three options should be specified. Set the option you want, then
# refer to the appropriate section below for that specific
# configuration. Possible values are:
# LOCAL - Back up to a local directory. Can also be anything already
# mounted on the local filesystem.
# OFFLINE - Back up to offline storage that must be mounted. Can be
# anything that you can mount and unmount, including a filesystem
# on a local block device or a remote NFS or CIFS/SMB share.
# REMOTE - Back up to a remote system directly via rsync. If you use
# this, you must define REMOTE_USER_HOST below and setup pubkey
# authentication vi ssh for the remote user and host.
#
STORAGE_TYPE="REMOTE"
#
# **********************************************************************
# ******************* Options for LOCAL storage type *******************
#
# There are no specific settings for the local storage type.
#
# **********************************************************************
# ****************** Options for OFFLINE storage type ******************
#
# Leave this entire section commented out for LOCAL or REMOTE storage.
#
# Mount parameters - Storage filesystem mount parameters. Should be what
# you'd type on the command line between the word "mount" and the
# mountpoint. See the manual page for the mount command (man 8 mount)
# for the available options.
#
#MOUNT_PARAMETERS="-t nfs nfsserver:/srv/ribs-backups"
#MOUNT_PARAMETERS="-t ext4 -U 433a2e61-25aa-4da5-a7c7-4d730a5793e7"
#MOUNT_PARAMETERS="/dev/sdc1"
#
# Remount read-only - Set this to true if storage should be remounted in
# read-only mode when not being used for backups.
#
#REMOUNT_RO=true
#REMOUNT_RO=false
#
# **********************************************************************
# ****************** Options for REMOTE storage type *******************
#
# Leave this entire section commented out for LOCAL or OFFLINE storage.
#
# Remote user and host - The user and host to connect to for backup
# storage. If you want RIBS to be able to run unattended, for example
# as a cron job, you will need to ensure that the user's ssh public
# key is listed in the remote host's authorized_keys file. This is
# usually done with the ssh-copy-id command, which also takes care of
# adding the host's key fingerprint to the local known_hosts file.
#
REMOTE_USER_HOST="user@backupserver"
#
# **********************************************************************