Skip to content

Instantly share code, notes, and snippets.

@TGion
Created April 24, 2023 11:30
Show Gist options
  • Save TGion/5ecbfd4d4ec66be206820afdf21912a9 to your computer and use it in GitHub Desktop.
Save TGion/5ecbfd4d4ec66be206820afdf21912a9 to your computer and use it in GitHub Desktop.
Sample custom periodic script
#!/bin/sh -
#
# $FreeBSD$
#
# Put into /usr/local/etc/periodic/daily
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
case "$daily_backup_system_enable" in
[Yy][Ee][Ss])
echo ""
echo "Backing up system configuration files:"
# Create list of installed pkg
pkg prime-origins > /usr/local/etc/pkg.installed
# Init
export RESTIC_PASSWORD_FILE=/usr/local/etc/restic-repo.passwd
export RESTIC_REPOSITORY=rclone:fritz.ftp:/FOLDER/gion-io-system
echo $daily_backup_system_dirs
restic backup $daily_backup_system_dirs -o rclone.connections=1
;;
*) rc=0;;
esac
exit $rc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment