RE: TVHeadend Backup/Restore » tvhbackup.sh
1 |
#!/bin/bash
|
---|---|
2 |
#Purpose = Backup Tvheadend
|
3 |
#Löscht per "rm" alle "*.tar.bz2" Dateien im Ordner "/Pfad eintragen/tvheadend_backup/", die älter als 5 Tage sind:
|
4 |
find -P "/storage/recordings/Tvhbackup/" -maxdepth 1 -type f \( -name '*.tar.bz2' \) -ctime +5 -exec rm {} \; |
5 |
TIME=`date +%Y-%m-%d_%H-%M-%S` # Datum im Backup Name. |
6 |
FILENAME=tvh42.backup_$TIME.tar.bz2 # Backup Name |
7 |
SRCDIR=/storage/.kodi/userdata/addon_data/service.tvheadend42/ # zu sichernder Ordner |
8 |
DESDIR=/storage/recordings/Tvhbackup/ # Speicherort Backup |
9 |
tar cvjf $DESDIR/$FILENAME $SRCDIR |