#Purpose = Backup Kodi
#save this file to /storage/.kodi/userdata/backup.sh
#define your backup-directory
#number of backups, which exists after the script will have been finished = NUM+1
#50 backups to be saved
ls -1tr "$DESTDIR"/*.tar | head -n -$NUM | while read -r i
TIME=`date +%Y%m%d%H%M%S` # date in backup name.
FILENAME=$TIME.tar # Backup Name
SRCDIR="/storage/.kodi/ /storage/.cache /storage/.config/"
tar cvf "$DESTDIR/$FILENAME" $SRCDIR_EXCLUDE $SRCDIR
The above is saved as backup.sh and put on my KODI usb stick.
I have a script that I can execute in kodi
Should be executed whenever I run my script. Nothing at all happens no backups nothing
The main difference is that you don’t place the ‘tar’ command (with the ‘cd’ command) in any directory and that has given me errors that I can’t explain (linux mysteries, maybe the problem is when the ‘tar’ command uses some temporary file in the working directory and it is part of the backup).