Skip to content

Instantly share code, notes, and snippets.

@ShockwaveNN
Last active November 16, 2020 08:57
Show Gist options
  • Save ShockwaveNN/e172b717242d8f3e6b036b0c08a3b0b7 to your computer and use it in GitHub Desktop.
Save ShockwaveNN/e172b717242d8f3e6b036b0c08a3b0b7 to your computer and use it in GitHub Desktop.
script for making backup of kodi settings
#!/bin/bash
DATE=$(date '+%Y-%m-%d-%H-%M-%S')
BACKUP_NAME=kodi-backup-$DATE.tar.gz
TEMP_BACKUP_LOCATION=/tmp/backups/kodi
BACKUP_DIR=/home/pi/.kodi
ARCHIVE_DIR=/media/routher_share/Backup/kodi
mkdir -pv $TEMP_BACKUP_LOCATION
chmod 777 $TEMP_BACKUP_LOCATION
FULL_BACKUP_NAME=$TEMP_BACKUP_LOCATION/$BACKUP_NAME
tar -zcvf "$FULL_BACKUP_NAME" $BACKUP_DIR
cp $FULL_BACKUP_NAME $ARCHIVE_DIR
rm $FULL_BACKUP_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment