Which folders are safe to exclude from backups?

Hello everyone!

Let me set some scene first.
I have a VM install from this repo (which is affiliated somehow with nextcloud developers, right?).
My installation is close to vanilla setup (except for a 2FA plugin, but I doubt that this matters) and planned to be used for home file storage.
I’m setting up automatic backup to a cloud storage and I could really use some space savings, even small ones =)

So, what files and folders of nextcloud data folder are safe to exclude from my backups? Right now I have these one excluded:

/mnt/ncdata/appdata_*****/preview (looks like a folder for image previews)
/mnt/ncdata/nextcloud.log (logs are useful, but not in backups, at least for me)
/mnt/<username>/uploads/ (looks like a temporary folder for user’s unfinished uploads, which I don’t really need as well)

Are these safe to exclude? And maybe there are more folders that I might filter as well?

trashbins?

setup a test machine and do a restore. :wink:

you have to backup a tb nas disc? or you just do a backup.tar.gz daily?

I use Duplicati and backup data folder and PostgreSQL database with it.

I could (and probably will) do that, but I thought that someone could already know. =)
I think backuping nextcloud instance is quite common task, so maybe someone already has some tips for me :grin:

I am wondering the exact same thing, although I’m doing my backups with another tool.

So far, I was thinking about adding the following --include-filelist, although I couldn’t find any documentation about what does what and if they’re safe to be removed:

- ./updater-*
- ./**/nextcloud.log
- ./**/dav-photocache/*
- ./**/preview/*
- ./**/files_trashbin/*
- ./**/cache/*
  • updater* has some conversations going on: https://github.com/nextcloud/updater/issues/178

  • nextcloud.log logs a lot of information and can become quite big. Also always changing, that would clutter the backups in my opinion.

  • dav-photocache is probably the folder used to cache contacts’ avatar.

    As far as I know, a file and a directory are created when upgrading Nextcloud to a new version. The file containes the status of the current update while the directory contains all the data before running into maintenance mode for the upgrade, which would be redundant in a backup.

Perhaps you look at the size for all dirs and the special dirs.
I think you do not save much space.
the previews are very small. Perhaps you can better delete the original files with MBs instead of previews with KBs. :wink: