Sync /home with some ignored directories

I run a Linux Desktop and try to syncronize my /home with Nextcloud Client V3.1.1, but with some ignored directories. But obviously I am not successful to define the ignored directories correctly in the sync-exclude.lst.

  1. What is the correct syntax to exclude in case I define /home to by synched with some ignored directories. Is it:

  2. where do I have to define the excludes in case I edit sync-exclude.lst directly. There is 2 files on my Desktop. One is in /home/user/.config/Nextcloud, the other one is in /etc/Nextcloud .

Thank you

I think it is not a good idea to “sync /home with some ignored directories”. On a linux system /home/user is not really an only-data-dir . In /home/user you can find data and configs.

Normally you use nextcloud for file sharing and not for backup or sync configs.
Now you want to define a “blacklist” for syncing. That is not really a good idea.
I think you must backup all data (with e.g. /home) to your backup space (not nextcloud).
And the user can decide which directorys e.g. /home/user/data, /home/user/photos should be synced to nextcloud.

I also sync /home with nextcloud and would like to know more about why devnull says it is not a good idea. Would you care to elaborate? Seems we should write a guest log post on how Nextcloud fits in someone’s personal information infrastructure. To clarify the differences between filesharing / backup / timemaching / source control and how they can be articulated.
To answer OP: How about using a whitelist approach instead? What I do here is sync each top level directory under ~. There are four: one for personal data, two for professional data, and one for media. I do not sync any hidden files in home. As devnull says, there are backups for that.

Yes. Then it is like syncing a list of directorys.

Thank you for the hints and remarks. I am aware of the fact that /home/user is not really an only-data-dir . But actually I see a need for me to copy and share many directories under /home/ into my nextcloud storage. And it seems to be much easier for me to exclude 10 sub-directories from being copied to nextcloud instead of defining 50 sub-directories to be shared with nextcloud.

So your discussion does not answer my questions. To be more general and to get rid off /home discussion;
how and where can sub-directories be excluded when trying to share /main_directory/ ?

Thank you

In the GUI client parameters, there is a “Modify excluded files” button. Did you try it?

Maybe the better way would be to just create a Desktop, Documents etc folder in the Nextcloud sync directory, copy all your files into those new folders and then delete those folders in your home directory and create a symlink into your home directory with the exact same names. This is actually something you can do on Windows out of the Box…