Backing up RasPlex

I’ve wrote a script that creates a backup of the /storage partition and tar it to a remote CIFS share.

I’ve noticed that the backup is several GB in size, this is likely due to the pre-caching content. As this can be rebuilt I want to exclude the directory where this content is stored

What paths can be safely excluded from a backup to bring the size down?

Are you aware that Rasplex has a built in backup facility that backs up the /storage folder into a tar file, the size of my backup tar file is 659Mb including the cached image files, not sure why you are getting several gigabytes unless you are copying the whole of the partition, which depending on the size of your SD card will include many gigabytes of empty space.

The built in backup is in System Settings, System, Create System and Plex HT backup.

When you have performed the backup which takes a couple of minutes just copy off the tar file from the Backup samba share.

If you need to restore a backup, flash an SD card the usual way using GetRasplex, boot, skip the initial boot screens, copy back your backup tar file to the samba share Backup, go to System Settings, System, Restore Backup, takes a couple of minutes, reboot and you are back up and running with all your Preferences settings, additional skins and settings and cached images.

Regards

I’m aware of the built in backup utility, however I wrote a shell script to automate the entire process to write the backup to a remote location of my choosing and scheduling it with cron, so I can leave it unattended, no GUI or interaction required.

I’m not copying the empty space, this is a filesystem level backup with tar not an SD card image or anything like that.

I’m guessing that somewhere within the plexht directory is a cache folder that’s being copied that doesn’t need to be.

The total size of all files and folders in the /storage partition is way less than a gigabyte, so if you are getting something with several gigabytes then there is something wrong with your script.

To check the size of the storage partition use:

 df -h

Regards

I think were getting our wires crossed slightly. The total size of the storage partition is whatever the size of the SD card after being expanded to the full space available, minus /boot and whatever else. My used space is about 1.8 GB

I’ve just reviewed a tar backup and found its the Thumbnails folder which is over 1.76 GB in size.

/storage/.plexht/userdata/Thumbnails

I can exclude this from being in the tar backup seems it can be regenerated from pre-caching if a reinstall is needed. That’s what’s inflating the backup archives.

I edited my post above your last one, don’t think our wires are crossed. For a Thumbnails folder that size you must have an enormous amount of media.

You could exclude that folder and pre-cache again on restoring the tar, haven’t tried it but it should be OK.

I’m still puzzled why you would want to do regular backups as a cron job, especially as you are now going to exclude the cached images. The only changes written to the SD card during every day use are log file entries, images for new media and any changes to preferences/system settings, however, each to their own!

Regards

Compared to some other setups on this forum, my storage setup is tiny in comparison, but I do have a fair bit I guess!

This Rapsberry Pi 2 has used RasPlex since 0.6 so could be some old cache stuff around. I could clear it re-run pre-caching and see if that brings things down.

If the built in backup utility did have cron scheduling abilities and be able to specify where to save the backup (as in remote CIFS share), I’d use it, but its minimalist for a reason I guess and inherited from OpenELEC, so hence why I manually tar it so I can do all this unattended.

Daily backups might be slightly overkill since not a lot changes on the FS as you rightly pointed out so I might change the frequency. I could also look into higher compression options as well with the expense of CPU power seems the jobs run in the middle of the night!

Thanks for your help.