Process Check: Is it OK to to this? (Automation scripts on TrueNAS Core, ie Debian)

I’m working on automating systems/infra backups of across my network. The backups will consist of items like VM files, config exports, etc. Not all of the systems have the same abilities/binaries/etc, such as rsync, cifs, ssh, etc.

To make it easy, my idea is this:

  1. Share out a general NFS on TrueNAS
  2. Automate each system to export its backup to the NFS
  3. In TrueNAS, create a script on a cronjob to parse the file name, then move it to the appropriate dataset based on the filename

Aside from having 20x unique network shares on TrueNAS for each system to export to, this is the best solution I can think of. However, I know that the underlying Debian OS is stripped down and doesn’t allow many things, so I wanted to check that this plan is doable and without any unintended downstream effects.

Edit to add: Additional Question

If I have a dataset owned by $user, and my script running the context of admin moves the file to that dataset, would that file inherit the permissions of the dataset, or would I have to also have the script chown the files?

Hello @farce, I’d say on the surface the answer to your question is ‘Yes’.

However, TrueNAS Core is FreeBSD based, where TrueNAS SCALE is Debian based.

I have loads of custom scripts doing things and haven’t had any issues. My scripts live in /usr/local/bin and they are kicked off by systemd timers that I’ve installed.

Typically one uses the WebGUI to create a cron job and that points to your custom script(s) to do ‘x’ thing at ‘y’ time, however I just prefer configuring timers and using systemd utilities.

Without any further context, yes, you may have to adjust your permissions to get it working.

Although TrueNAS is locked down as an appliance, there’s still plenty of functionality to be able to do most if not all things that I need it to do.