Adding/changing SMB share permissions from commandline or script


Recommended Posts

For backups, once a week I shutdown all of my VMs which are on my cache drive. Then I create a read only BTRFS snapshot, immediately start the VMS back up and then backup up from a samba share of this read only snapshot.  This keeps the VMs in a clean state but minimizes the amount of downtime. The snapshot is removed after the backup is complete.

 

Anyway, this works alright except the samba share for the snapshot will not exist if unraid has been rebooted causing the backup to fail. It seems like the shares are recreated on startup or something and since the snapshot doesn't exist when this happens the share doesn't work. To fix I create the snapshot and then just toggle a user account from read to read/write and back in the SMB share settings.

 

But I don't know how to do this in the command line to assure the backup works every time it reboots.

 

So my question is can I change a user setting somehow through the command line or otherwise restore this state?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.