Nextcloudcmd fails to sync all files

Hi all,

we set up a file server for a small office to share files via Samba. The files directory is then synced via nextcloudcmd to a Nextcloud instance running at some hosting provider.

nextcloudcmd is running on the Samba server, so it’s all local files, no remote mounts or similar. The reason behind that setup is that the users prefer to have file server semantics while at the office, still have a copy of all the files available in the cloud when they are on the road. Main work is done on the file server, that’s why we picked a setup like this.

Worked great and has been running for a couple of weeks, now. Suddenly users complain that certain files are not showing up in the “web cloud” while they are definitely on the file server.

Simple things we checked:

  • system time, NTP, timestamps of files - OK
  • we use a single dedicated nextcloud user for this synchronization
  • we wrote a shell wrapper that guarantees that there are no multiple jobs running in parallel

When a nextcloudcmd sync job is running, it is invoked like this:

/usr/local/bin/nextcloudcmd -n --non-interactive --logdebug /var/nextcloud https://url.of.my.cloud >>"${LOGFILE}" 2>&1

I see INSTRUCTION_NEW entries for new files, but somehow they never make it to the server or they appear literally days later. We currently run one sync per hour and this is sufficient to process the entire file tree …

Any hints what I should look for greatly appreciated.

Patrick

1 Like

I was finding 503 errors in the apache log for certain files. When I tried to view the offending files in the web interface, they were “missing”. They had an entry, but there was no corresponding file on the filesystem for them. Once I deleted them from the web interface, I was able to sync again.

As an alternative, you might consider setting up a VPN between the nextcloud and samba servers and setting up SMB external storage. Then the files would always be live with no need to sync.

Another option might be to mount WebDAV at the samba server, move files to it, and share the WebDAV mount via SMB.

I can’t say for sure based on available info if this is the case, but in a setup like yours, I would be very wary of users accessing files at the same time on both ends causing sync conflicts.