Initial commit

This commit is contained in:
2026-04-05 16:23:17 +00:00
commit 6c75e00159
42 changed files with 3859 additions and 0 deletions

22
backup/jobs/html.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
LOCK="/usr/scheduler/backup-html.lock"
if [ -f "$LOCK" ]; then
echo "Another instance of $0 is running, exiting..."
exit 1
fi
touch $LOCK # Creates the file
trap "rm $LOCK" EXIT
echo "Begining backup of HTML files..."
#if [ -f "/srv/backup/html/html.tar.gz" ]; then
# echo "Rotating existing backup files..."
# logrotate /usr/scheduler/logrotate_backup_html
#fi
#echo "Creating tar gzip archive..."
#tar -zcf /srv/backup/html/html.tar.gz /srv/data/html/
rsnapshot daily
echo "Backup finished!"

22
backup/jobs/sql.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
LOCK="/usr/scheduler/backup-mysql.lock"
if [ -f "$LOCK" ]; then
echo "Another instance of $0 is running, exiting..."
exit 1
fi
touch $LOCK # Creates the file
trap "rm $LOCK" EXIT
echo "Beginging backup of DB_1..."
FILE=/srv/backup
if [ -f "/srv/backup/sql/db_1.sql.gz" ]; then
echo "Rotating existing backup files..."
logrotate /usr/scheduler/logrotate_backup_sql
fi
echo "Dumping datbase DB_1..."
mariadb-dump --skip-ssl --opt -h localhost -u root -p$MARIADB_ROOT_PASSWORD db_1 | gzip -c > /srv/backup/sql/db_1.sql.gz
echo "Backup finished!"