Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
LOGFILE=/var/log/mysql_backup
DIR=/var/mariadb/
DIRNEW="${DIR}backup_new/"
DIROLD="${DIR}backup_old/"
USER=YOUR_DB_USER
PASS=YOUR_DB_PASSWORD
date +"# Start Backup Mysql at %T %D" >> $LOGFILE
if [ ! -f %DIR ]; then
mkdir $DIR 2>> $LOGFILE
@leskovia
leskovia / backuplxc.sh
Created April 13, 2023 23:11
Copy running lxc containers to reserv host
#!/bin/bash
#Set destination host
DHOST="lxchost2"
#Get list of running LXD containers
LXD_CONTAINERS=$(lxc list -c n,s --format csv | grep RUNNING | awk -F, '{print $1}')
LOGFILE="/var/log/lxcbackup.log"
LOCKFILE="/var/log/backuplxd.lock"
if [ -f %LOCKFILE ]; then
echo "Already running" >> $LOGFILE
exit 1
@leskovia
leskovia / gist:4c7b829cefea00f1aa1bcbaf387bdc9e
Created January 9, 2022 14:17 — forked from karmanov/gist:499e0dfdf8e5ce119ad4
spring.jpa.hibernate.ddl-auto values
validate: validate the schema, makes no changes to the database.
update: update the schema.
create: creates the schema, destroying previous data.
create-drop: drop the schema at the end of the session.