Files
scripts/config-backup.sh
2026-03-24 00:03:59 +01:00

24 lines
627 B
Bash
Executable File

#!/bin/bash
# Set the paths for the source and destination directories
SRC="/home/belar/.config"
DST_DIR=/mnt/nas_belar/rsync/config-backup/
# Sync the source directory to the destination directory
#/usr/bin/rsync -CERrltm --delete "${SRC}" "${DST_DIR}"
/usr/bin/rsync -CERrltm --delete "${SRC}" truenas-belar:/mnt/DATA/USER_DATA/belar/rsync
# Change to the Git repository directory
cd $DST_DIR
# Commit the changes with the current date as the commit message
git add .
git commit -m "$(date +%Y-%m-%d-%H-%M)"
# Push the changes to the remote repository if one is configured
if [ "$(git remote)" ]; then
git push
fi