Created
April 24, 2023 11:30
-
-
Save TGion/5ecbfd4d4ec66be206820afdf21912a9 to your computer and use it in GitHub Desktop.
Sample custom periodic script
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 - | |
# | |
# $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