Owncloud not syncing all folders

What to do when owncloud does not want to sync all folders

I recently had a problem with owncloud not synchronizing all folders correctly. Below I present a possible solution to the problem.

Problem

I recently had a situation where owncloud 8 was not synchronizing files correctly with my server. In my specific case I accidentally unticked some folders from the files selection. When I realized this was a mistake because all the local files would also be deleted, I ticked the folders again, only to find out that after that they were not synchronizing any more. The contents were deleted from the local machine, but even though the folder was ticked the contents from the server was not restored again to the local machine.

Some things to try

Try forcing a resync

The first thing I tried was to force a resync by pressing F5 in the owncloud client desktop window. This only synchronized a few files, but more than 4 GB was still missing.

Get the server to rescan all files

On the server the following command line can be executed to try and force the server to pick up files that it is missing (this was for an Ubuntu 14.04 server):

sudo -u www-data php occ files:scan --all

This forces the server to look for newly added files on the server.

This partly alleviated my problem, but only about 700MB of the missing files were resynced in this way.

Make temporary files in every folder to force resync

I noticed that if I log into the web interface of owncloud, and edited a file in a folder that would not sync, then owncloud would recognize that the file have changed, and then the whole folder would sync correctly. This gave me a hunch to create an empty temp file in every folder the following way:

sudo -u www-data find . -type d -exec touch {}/owncloud.user.temp \;

You need to be in the /var/www/owncloud/data/<user>/files folder to run the above command. This created a file called owncloud.user.temp in every folder. Owncloud picked up that a new file was created, and subsequently every folder was resynced, and all files were back on my local drive.

Afterwards you can delete the owncloud.user.temp folder in every folder again.

Conclusion

I have presented a few ideas on what to do if your owncloud does not want to sync properly any more. I hope this helps a few people out there. If you have more ideas, questions or comments please feel free to use the commenting below.

armand Saturday 10 October 2015 - 11:31 am | | Default
Used tags: , ,

One comment

Cheap essays

Great site and a great topic as well I really get amazed to read this. It’s really good. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge.

Cheap essays, (URL) - 14-12-’16 09:37
(optional field)
(optional field)
Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.