One way sync with samba

Hi,

I’m trying to achieve the following:

To one-way sync a samba share through external storage app to the client pc’s.

I did the following:

  1. Create samba samba share on a windows domain with user test only read permissions

  2. Added this external storage in Nextcloud, giving the credentials of user test

  3. Check wheter I don’t have write permissions by creating folder. Message: Could not create folder "New folder": ok only read permissions

  4. Added a file to the samba share -> is synced to client pc

  5. Deleted the file on the client pc: NOT deleted on NC (OK) but error synchronizing:
    test cloud/test file.txt, Nextcloud - ncadmin,Error transferring https://[domain]/remote.php/dav/files/ncadmin/test cloud/test file.txt - server replied: Forbidden

Expected behaviour: file is synchronised to the client pc as it’s still on NC

I did the same experiment but with ‘group folders’ giving no write nor share permissions and this does work as intended, although for our application this is no option.

Could someone advise me how to achieve this one-way syncronizing with samba external shares please?

kr
wouter

Okay, I think I follow what’s happening here. You deleted the file in a way that is external to Nextcloud. So when the user deleted it on external storage, it wasn’t aware of the delete. Adding this to your config.php MAY help:
'filesystem_check_changes' => 0,

Be sure to check it in the documentation here to see if you think the change might be right for you, and see if it even works. This config (IIRC) will check to see if you made external changes to data. Hope this works/helps!

Hi, i tried it but the error remains. Just to clarify: the user does not delete it on external storage, but on the PC itself (ie the nextcloud sync folder) so I guess the mentioned option is no use for my case.

Maybe I could use workflow access (still have to read the documentation regarding this subject).

thanks,
wouter

This make sense. You delete it from NC client and Client tries to delete file from Samba. Samba replays that it is forbidden --> you have an error, but you could not delete file from the samba (read only).

I think your expectation is that client could not delete file at all, or at least it does not make any changes on NC DB.
Solution: Try to add Samba as other user - e.g. administrator and share it with NC user as Read Only - this will help.

1 Like

@gas85
Perfect! I did as you said: changed the samba user to one with write permissions, added the share only to nextcloud-administrator and shared with users with “can edit” flag off.
When I delete a file now it is automatically downloaded again immediately :slight_smile:

thanks!

1 Like

Ahh I misunderstood the situation then, I’m glad you got it resolved!