I’ve been reading this forum for quite some time and I find the discussion very interesting. My interest in restic increased over time Today is my first post
I’m starting to put together the scripts and configuration for the backup of my Fedora Linux box. I will backup to SFTP, S3 and local. I was successful on initializing the repository on the different destinations.
I would like to use the rclone backend. For this I’d like to put the rclone configuration file at the same place as the restic and other configuration files (e.g.
The rclone command itself allow to specify the configuration file with the
--config option. Example:
rclone --config=$HOME/./restic/rclone.conf config
When using the rclone backend with restic, is there a way to specify the path to
rclone.conf ? I’d like to now if it’s doable. Otherwise I’ll simply create a symlink.
Hey @MorgothSauron and welcome to the restic community!
So as far as I understand this is, you have restic and rclone installed. Right?
If that’s the case, then the restic documentation for the rclone backend suggests that you can safely use the rclone environment variables and restic will honor them.
Other Services via rclone
Rclone can be configured with environment variables, so for instance configuring a bandwidth limit for rclone can be achieved by setting the
RCLONE_BWLIMIT environment variable:
But there is also this:
The rclone backend has two additional options:
-o rclone.program specifies the path to rclone, the default value is just rclone
-o rclone.args allows setting the arguments passed to rclone, by default this is serve restic --stdio --b2-hard-delete --drive-use-trash=false
So maybe this is what you were looking for in the first place.
Hope this helps And if so, please let us know.
@moritzdietz Yes, I already have both restic and rclone installed on my system. I have a repository on S3 that I was able to check using rclone. The rclone environment variables seems very promising. It’s a bit late for me to try now, but I’ll check that tomorrow and post back. Thank you.
Awesome! Sure thing - we’re here
Posting back following a quick tests I made.
- Set environment for SFTP remote
$ export RCLONE_CONFIG_SFTP_TYPE=sftp
$ export RCLONE_CONFIG_SFTP_HOST=piserver
$ export RCLONE_CONFIG_SFTP_USER=restic
$ export RCLONE_CONFIG_SFTP_KEY_FILE=~/.ssh/id_rsa_restic
- List repository content with rclone only
$ rclone ls sftp:/home/restic/repository | head
2019/09/17 19:22:30 NOTICE: Config file "/home/morgoth/.config/rclone/rclone.conf" not found - using defaults
$ restic -r rclone:sftp:/home/restic/repository list snapshots
rclone: 2019/09/17 19:23:47 NOTICE: Config file "/home/morgoth/.config/rclone/rclone.conf" not found - using defaults
enter password for repository:
repository 8fe564d8 opened successfully, password is correct
I got the expected results using only environment variable. I deleted the default rclone config file before starting my testing. I was also able to perform the same test using a S3 backend.
The rclone documentation also indicates:
Rclone can be configured entirely using environment variables
At this stage it’s clear for me that using rclone environment variables is the ideal solution for my use case.
Thank you for the help !
Thanks for the detailed report and awesome you got your setup working the way planned to