Worried about deleted and moved files with MacOS

Status
Not open for further replies.

hendry

Explorer
Joined
May 24, 2018
Messages
98
Hi, I organise my files in a YYYY-MM-DD structure. Once files are in that structure, I want to archive them so they can't be accidentally moved with a careless drag from a Finder window.
Can I achieve that with FreeNAS?

Or perhaps can deletions be move to a recycle bin? I think I have enabled that feature now, but I don't see a recycle folder. Or perhaps is there a log?

Sidenote: is Samba the best choice for sharing folders with MacOS 10.x?

https://s.natalian.org/2018-06-09/freenas.mp4

I'm also how can I avoid .DS_Store and these empty .apple files ?

Thank you!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hi, I organise my files in a YYYY-MM-DD structure. Once files are in that structure, I want to archive them so they can't be accidentally moved with a careless drag from a Finder window.
Can I achieve that with FreeNAS?
That's a tricky one. I don't think there's an easy way to do that. Once you prevent people from moving files, you're preventing them from being able to rename them as well. This can quickly turn into preventing users from naming them in the first place, and makes the whole share an unusable mess.

Or perhaps can deletions be move to a recycle bin? I think I have enabled that feature now, but I don't see a recycle folder. Or perhaps is there a log?
It's better to just use ZFS snapshots. Update to 11.1-U5, create snapshot tasks, then set the auxiliary parameter on the share "expose_snapdir=yes", from the command line type "zfs set snapdir=visible <pool>/<dataset>" for the dataset you're sharing, then restart samba.

This will make it so that your OSX clients can navigate to smb://server/share/.zfs and browse / restore previous versions of files.

Sidenote: is Samba the best choice for sharing folders with MacOS 10.x?
It depends on what you want.

I'm also how can I avoid .DS_Store and these empty .apple files ?
You change it client-side in OSX.
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE


See here: https://support.apple.com/en-us/HT208209

I know some people try to veto them server-side. That's not a good idea. Fix the client.
 

hendry

Explorer
Joined
May 24, 2018
Messages
98
Thank you for your help!!

This will make it so that your OSX clients can navigate to smb://server/share/.zfs and browse / restore previous versions of files.

But that won't tell me what changed right? Diffing snapshots is not practical is it?

Can old snapshots be made to expire after say a month? Since if I do delete a file, I want it to be eventually deleted.

It depends on what you want.

A stable network mount. For example if I switch to wifi, my experience was that NFS mounts went haywire on MacOS.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
But that won't tell me what changed right? Diffing snapshots is not practical is it?
Well, diff-ing snapshots in zfs is extremely easy... it's just not exposed in the UI. You can list snapshots i.e. zfs list -t snap | grep <stuff>, then choose two snapshots in the same dataset and do something like:
Code:
root@catherder:~ # zfs diff freenas-boot/ROOT/11.1-U4@2017-10-28-21:22:40 freenas-boot/ROOT/11.1-U4@2018-01-19-07:59:24
M	/
M	/boot
M	/data
M	/data/freenas-v1.db
M	/data/zfs
M	/boot/zfs
M	/root
M	/usr/local/lib/python2.7/site-packages/django/core/mail/backends
M	/usr/local/www/freenasUI
M	/boot/zfs/rpool.cache
-	/boot/loader.conf
+	/boot/loader.conf
-	/boot/loader.conf.local
+	/boot/zfs/zpool.cache
-	/boot/zfs/zpool.cache
+	/boot/loader.conf.local
M	/data/crash
M	/root/.ssh
M	/data/zfs/zpool.cache.saved
-	/data/zfs/zpool.cache
+	/data/zfs/zpool.cache
M	/.rnd
-	/entropy
+	/entropy
-	/usr/local/www/freenasUI/local_settings.pyc
+	/usr/local/www/freenasUI/local_settings.pyc
M	/root/secrets.tdb
+	/root/.ssh/authorized_keys
+	/usr/local/lib/python2.7/site-packages/django/core/mail/backends/__init__.pyc
+	/usr/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.pyc
+	/usr/local/lib/python2.7/site-packages/django/core/mail/backends/base.pyc
+	/root/.ssh/known_hosts
M	/root/.history


If you need details about who deleted what and when, then you need to configure vfs_full_audit and log success and failure for unlink operations.

Can old snapshots be made to expire after say a month? Since if I do delete a file, I want it to be eventually deleted.
Yes, this is what configuring a snapshot task does for you. See FreeNAS guide.

A stable network mount.
Stable mount? OSX? I'm an admin, not a magician. :D
 
Status
Not open for further replies.
Top