Copy Files from Windows SMB Share To TrueNAS (Must Be Initiated From TrueNAS)

X-Savior

Cadet
Joined
Dec 21, 2021
Messages
8
Good Day Everyone!

I am looking for a solution to copy files from various Windows SMB shares to TrueNAS... BUT...the catch is it must all be done FROM TrueNAS side.

I am building a life raft Server that is almost completely air-gapped. We are using Firewall rules on our Corporate Network to allow one-way traffic for the TrueNAS to be able to reach out to our various Windows SMB Shares.

The TrueNAS need to initiate, connect to the Windows SMB Shares and then copy the files back for archiving. No devices on the network will be able to see/communicate with the TrueNAS but the TrueNAS can communicate outbound with the specific servers required.

Should I be looking at using some custom Bash Scripts that I can schedule with Cron, or is there a better approach I can use for this purpose?

Thank You!
 

X-Savior

Cadet
Joined
Dec 21, 2021
Messages
8
Gets you started :
Thank you very much, this has helped.

By chance might you know of a commandline copy command in TrueNAS that will copy only changed files?

In Linux you can use -U with cp command.... but I can not seem to find anything like this for FreeBSD.

Right now I am using: cp -R -p -v "Source" "Destination"

Thank You!
 

HarryMuscle

Contributor
Joined
Nov 15, 2021
Messages
161
You can also use smbget if you don't want to mount the share. It's basically a samba equivalent to wget.

Thanks,
Harry
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
You could presumably use rsync to copy only changed files. Once you have interpreted the complex commandline. Rsync can apparently do anything if you have the patience to work out how!
:smile:
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Wouldn't a cross-platform backup system like Amanda or Bacula be better suited to the task? Needs installation of an agent on all Windows backup clients, but then the server can poll the clients, do incremental dumps, rotate over a collection of virtual "tapes", ... etc.
 

X-Savior

Cadet
Joined
Dec 21, 2021
Messages
8
Thank you for the information.

smbget is an intriguing idea.

I looked at rsync but it appears to be more of an SSH transfer (and yes I had a hard time getting my heard around it).

I agree we could use a backup software (Like Acronis Advanced) but I was trying to get a very simple but robust solution that left nearly no footprint.
'
One thing that occurred to me was that there is no local control panel for TrueNAS making it difficult to justify in a situation where this Server will be an autonomous unit... and should the worst case scenario occur it would not be easy to just login to the local console and get it up and running (you would need another machine to get access to it.

Since I am not really using anything that TrueNAS offers and trying to customize a solution... why am I forcing TrueNAS to work? I am going to explore using Ubuntu /w ZFS... I might be just as well off going this route.

This Server is planned to sit quietly on the 10GB backend Storage Network with no connectivity to the primary FrontEnd network. It will reach out to get it's backups and be protected/isolated from anyone reaching the Server. The idea is the only way to work on the Server is with a Local Console on the actual Server (Providing us the closest we can get to an Air Gapped life-raft emergency backup solution).
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Not Acronis. An Open Source backup server running on TrueNAS (in a jail) or plain FreeBSD or plain Ubuntu pulling the data from the Windows machines with the "air gap light" mechanism you want in place.

That software will take care of incrementals and rotation and will be much less work than scripting yourself with smbget or rsync ...

Look into Amanda or Bacula - both have Windows agents.
 

X-Savior

Cadet
Joined
Dec 21, 2021
Messages
8
Not Acronis. An Open Source backup server running on TrueNAS (in a jail) or plain FreeBSD or plain Ubuntu pulling the data from the Windows machines with the "air gap light" mechanism you want in place.

That software will take care of incrementals and rotation and will be much less work than scripting yourself with smbget or rsync ...

Look into Amanda or Bacula - both have Windows agents.
Thank you very much! :)

I will look into this. Yes that does make sense.
 
Top