Exclude local folder from syncing to server

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version : Ubuntu 20.04
Apache or nginx version : nginx/1.18.0 (Ubuntu)
PHP version : 7.4.3

The issue you are facing:

Hi folks,

I would like to exclude some of my really big subfolders inside my Nexcloud folder. It happens to me that my virtual environment from python get really big and NC is trying hard to sync all those files. After a very long time (days) it throws errors, because local and server version does not match. My main problem is, that it constantly try to look for changes on my server and does not focus on the things I need (syncing).

So I would like to exclude all my virtual environments and all my build files from syncing. I need them on my local storage and not on my server.

I don’t want to add all those files and file types to my “Ignored Files” list, but simply my local folders.

Is there an easy fix to my problem?

Remove local files.

Is this the first time you’ve seen this error? (Y):

Steps to replicate it:

  1. Put a folder with thousands of files inside my NC local folder
  2. wait a few hours to days
  3. look at all those error messages (file missmatch, operation timeout, bad signature, connection closed and so on → everything is only shown in my client sync tool)

The output of your Nextcloud log in Admin > Logging:

empty, no errors or warnings

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '###########',
  'passwordsalt' => '#############',
  'secret' => '###############',
  'trusted_domains' =>
  array (
    0 => '######',
    1 => '######',
    2 => '######',
  ),
  'datadirectory' => '/var/nextcloud_data',
  'overwrite.cli.url' => '######',
  'overwritehost' => '######',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud_db_user',
  'dbpassword' => '######',
  'logtimezone' => 'Europe/Berlin',
  'installed' => true,
  'log_type' => 'file',
  'loglevel' => 2,
  'logdateformat' => 'F d, Y H:i:s',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'updater.release.channel' => 'stable',
  'mail_from_address' => '######',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '######',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '465',
  'mail_smtphost' => '######',
  'mail_smtpname' => '######',
  'mail_smtppassword' => '######',
  'mysql.utf8mb4' => true,
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'trashbin_retention_obligation' => 'auto, 30',
);

The output of your Apache/nginx/system log in /var/log/____:

empty, no errors or warnings

Exclusion list (“Ignored Files”) can also match a directory. For instance, the rule “~$*” would exclude a folder named “~$temp” (and its entire content) from synchronization.

You can create a rule in the local Nextcloud client that matches the folder you need to exclude. That’s the simplest way (at least, the only way I know) to achieve what you want to do.