Rclone: Difference between revisions

Onny (talk | contribs)
No edit summary
Onny (talk | contribs)
Add example configuration, SFTP mount
Line 2: Line 2:


== Configuration ==
== Configuration ==
Mounting remote filesystem, in this example via SFTP. The remote profile is called <code>myremote</code>, and authentication is done with user <code>myuser</code> and key file <code>/root/.ssh/id_rsa</code> against <code>192.0.2.2</code>. The remote directory <code>/my_data</code> is than mounted to the local directory <code>/mnt</code>.<syntaxhighlight lang="nix">
environment.systemPackages = [ pkgs.rclone ];
environment.etc."rclone-mnt.conf".text = ''
  [myremote]
  type = sftp
  host = 192.0.2.2
  user = myuser
  key_file = /root/.ssh/id_rsa
'';


fileSystems."/mnt" = {
  device = "myremote:/my_data";
  fsType = "rclone";
  options = [
    "nodev"
    "nofail"
    "allow_other"
    "args2env"
    "config=/etc/rclone-mnt.conf"
  ];
};
</syntaxhighlight>
[[Category:Applications]]
[[Category:Applications]]
[[Category:Backup]]
[[Category:Backup]]