In Linux the read on a file is different then a read on a folder and nextcloud is a ….

I’ve been implementing syncthing (ST) as a backup utility. ST say themself that the application isn’t a backup utility, but for me it does the trick.

Nextcloud is a …….
Yesterday i was implementing ST on my nextcloud server. I only wanted to backup my data to the ST server. The data directory had a mode of 770 for www-data:www-data. So another account didn’t have access to the directory. After changing the mode to 774, other accounts should have read access to the directory. After a couple of minutes the mode was back to 770. Of course you think you did something wrong, or you chmod the wrong directory, but after 5 times i knew the rights were set OK.

So the  nextcloud software was setting the mode back. After checking if there was a setting in de GUI, i couldn’t find any. Then the big google it is. Thankfully it lead to a page with a config option: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html
One option is: ‘check_data_directory_permissions’
Default it is set to true even if it’s not explicitly set. After adding the setting to config/config.php in the main folder the chmod of the data folder staid the same.

NextCloud is a nice peace of software! 😛

Syncthing doesn’t read folders ….. AKA In Linux the read on a file is different then a read on a folder

After fixing the first issue i wanted to sync the data structure to ST, but it only synced the first 600MB of the 185GB. In the logging the underlying data directory still wasn’t scanned because there was an issue accessing the underlying directories. Checked the directory mode: still 774 (rwx/rwx/r–), so it should be able to access the directory, because it could access the files had mode 664 (rw-/rw-/r–). After almost an hour i finally found it. The mode of the directory can have the same mode as a file, but the effect is different. Main issue is that you need the X right to access the directory. If you only have read you can read the content of the directory, but not the files or directories in the directory. The problem starts at the data directory and not at anyone of the sub-directories.

After changing the mode to 665, ST could read the subfolders and the sync is running nicely. Not fast (backup server is a Raspberry Pi 3, with an USB 3TB harddisk), but i rather have a backup that i can restore by placing the external disk to another PC, then to not have a backup at all.