iocage exec 'jail' ~ rclone

Supa

Patron
Joined
Jan 10, 2014
Messages
204
Trying to setup rclone.

This command works in the jail:

rclone sync /media/backups gdrive:Media/Backups

but I'm trying to set up a cronjob and it doesn't execute.

iocage exec rclone sync /media/backups gdrive:Media/Backups

Is this not the command I should be using?
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
You post too less information for anybody to help.

What is the error message you get?
Does the iocage command work, if not being called from called from cronjob?
If the command works in the jail, why not set up a cronjob inside the jail?
 

Supa

Patron
Joined
Jan 10, 2014
Messages
204
If the command works in the jail, why not set up a cronjob inside the jail?

I didn't really know the syntax. And it seemed easier from FreeNAS itself.

1574693071151.png
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
I didn't really know the syntax. And it seemed easier from FreeNAS itself.
Apparently you also got the syntax of the iocage command wrong:
Code:
~# iocage exec --help
Usage: iocage exec [OPTIONS] JAIL [COMMAND]...

  Run a command inside a specified jail.

Options:
  -u, --host_user TEXT  The host user to use.
  -U, --jail_user TEXT  The jail user to use.
  --help                Show this message and exit.

Do you see the difference to the command you issued?
It was probably not a good idea to name the shell exactly after the command you mainly use there ;)
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I thought the GUI is lacking a bunch of rclone features?
It is, but that doesn't mean you can't use it from the CLI.
 

Monkey_Demon

Explorer
Joined
Nov 11, 2016
Messages
85
Why are you putting rclone in a jail? It's part of the base FreeNAS install.
I am also putting rclone in a jail. I have at least 3 reasons:
  1. I'll be using it to backup my system, including all user data, and a jail seems more secure.
  2. To get help on the rclone forums, helpers usually want you to be running the latest version of rclone. FreeNAS does not run the latest version. E.g. FreeNAS 11.3-RELEASE uses v1.49.4, but the current rclone is v1.51.0. Besides, even if the helpers didn't want this, I like the freedom of running the latest version if I choose.
  3. I couldn't find the location of the rclone configuration file in the FreeNAS documentation. OTOH, the standard rclone documentation told me where the file goes. Since then, I've learned more about rclone and now know I could used "rclone config file" to learn where the configuration file is/goes. So I can see where it goes in the FreeNAS shell and, in the jail's shell, where rclone puts it.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I am also putting rclone in a jail.
Of your reasons, the second makes some sense. And, of course, the general guidance is that any software installation shouldn't be done in the base OS, but rather in a jail. rclone is somewhat unusual, though, in that it's a standalone binary which can run on its own without any supporting libraries or other software. As a result, there's no real reason not to put it somewhere on your pool and call it with an explicit path--I still tend to think a jail for rclone is unnecessary.
 

Monkey_Demon

Explorer
Joined
Nov 11, 2016
Messages
85
Of your reasons, the second makes some sense. And, of course, the general guidance is that any software installation shouldn't be done in the base OS, but rather in a jail. rclone is somewhat unusual, though, in that it's a standalone binary which can run on its own without any supporting libraries or other software. As a result, there's no real reason not to put it somewhere on your pool and call it with an explicit path--I still tend to think a jail for rclone is unnecessary.

Actually, I just thought of a fourth, and perhaps most important, reason. In a pool I can create a directory, /mnt/Backup, and attach several external mount points to it. Then a single rclone command, rclone copy /mnt/Backup ArbitraryRemote: can back up everything one wants to back up, in one swell foop.

I suppose without jails one could write a script including separate rclone commands for each external dataset one wants to include. Or, perhaps, do something fancy with symlinks. But it seems to me the mount-point-in-jail solution is easier to implement and maintain (assuming one understands how to deal with permissions -- something I'm still learning; see the Need help understanding permissions for mount points in jails thread that I just started :confused: ).

I remember reading somewhere about components "doing one thing well" leading to good computer system design. ;)
 
Last edited:
Top