CronJob - Copying files from a samba share to a TrueNAS share / folder

matclou

Dabbler
Joined
Feb 15, 2020
Messages
33
Hi!

I am currently running TVHeadend on a RaspberryPi. It stores recordings in a folger which is accessible via a Samba Share. Now I want to move the available files from this samba share to a folder within TrueNAS regularly, let us say once a day.

My idea was to accomplish this with a CronJob. Can I simply do this by using the following command? Is smbget available?

Code:
smbget -Rr smb:\\aaa.bbb.ccc.dd\recordings -U "USERNAME@PASSWORD" -o \\eee.fff.ggg.hhh\[FOLDER]


aaa.bbb.ccc.dd = IP adress of raspberry pi / tv headend

eee.fff.ggg.hhh = IP adress of TrueNAS

Best regards and thanks for you valuable comments!

PS: I am using TrueNAS-12.0-stable
 
Last edited:

matclou

Dabbler
Joined
Feb 15, 2020
Messages
33
And is it correct to use the IP Adresse of TrueNAS even though it is in the same directory? Or ist there another was to assess it?
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177

matclou

Dabbler
Joined
Feb 15, 2020
Messages
33
I had a closer look at the help and I understand that I cannot use the o- option because I want to copy a directory. But where is the standard path for downloads when I cannot specify the exact path - where could I find the downloaded files? Or should I use the standard output -O?

PS: I am now using:

Code:
smbget -Rr smb://aaa.bbb.ccc.dd/recordings -U USERNAME%PASSWORD
 

matclou

Dabbler
Joined
Feb 15, 2020
Messages
33
I would like to add something: Seems like the file is downloaded to the very root directory of freenas ... (root@freenas[~] in the shell) - Is there any way to change this?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
cd /target/directory first?
 

matclou

Dabbler
Joined
Feb 15, 2020
Messages
33
Good advice! :cool: I have to admit I first have to dive into this logic of commands. I think I will try to write something like a script to be able to combine multiple commands.
 
Top