Skip to content

Instantly share code, notes, and snippets.

View Dilden's full-sized avatar
🏠
Working from home

Dylan Hildenbrand Dilden

🏠
Working from home
View GitHub Profile
@Dilden
Dilden / backups.sh
Last active October 30, 2019 14:06
Copy LXC backups
#!/bin/sh
THEDATE=`date +%d%m%y%H%M`
CONTAINER_PATH="/var/lib/vz/dump/"
#MEDIA_PATH="/ mnt/shared/Media"
LOCAL_BACKUP_PATH="/media/backups/"
# Copy LXC backups (that are < 2 days old) from host to mounted drive
find ${CONTAINER_PATH} -name vzdump-lxc-*.tar.gz -mtime -2 -exec cp {} ${LOCAL_BACKUP_PATH} \;
@Dilden
Dilden / ddns.sh
Last active February 12, 2021 02:22
DDNS via Cloudflare API
#/usr/bin/env sh
# Date
DATE=`date +%Y-%m-%d_%H:%M:%S`
# Get the ZoneID from: https://www.cloudflare.com/a/overview/<your-domain>
DNS_ZONE=YOUR_ZONE_ID_HERE
# Get the existing identifier for DNS entry:
# https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
#!/bin/sh
THEDATE=`date +%d%m%y%H%M`
MEDIA_PATH="/mnt/shared/Media/"
LOCAL_BACKUP_PATH="/media/backups/Media/"
# Backup shared media
rsync -r ${MEDIA_PATH} ${LOCAL_BACKUP_PATH}
if [ "$?" -eq "0" ]
then