Everything is working properly, but I cannot run rclone at startup.
I installed rclone with my user and with the command:
/usr/bin/rclone --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/
I can mount and everything is working.
Now, I want to startup the computer with this command running.
I tried from “Autostart” to add the command but is not working, even with the option “run as: [user]”.
I also tried with:
/usr/bin/runuser -l dlynfox -c “/usr/bin/rclone --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/”
If it is safe in your environment, you can set the RCLONE_CONFIG_PASS environment variable to contain your password, in which case it will be used for decrypting the configuration.
You can set this for a session from a script. For unix like systems save this to a file called set-rclone-password
I put mine in a file called ~/.config/plasma-workspace/env/set_rclone_config_password.sh
It runs automatically on startup. The file is small, only 2 lines:
Hi,
I tried to create that file.
Then I added a “startup” command with this command:
usr/bin/rclone --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/
with the option “Run as user:” and put my username “dlynfox”.
Now after the login it prompt a terminal asking me the password.
If I type my password the rclone mount OneDrive correctly.
Reading the documentation, I also tried the --password-command option, but it’s not working.
/usr/bin/rclone --password-command echo “” --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/
So, I’m by no means an expert, just keep that in mind.
Firstly, that file only runs when I login to KDE. So, it doesn’t set the variable for anything before that. I do not start my rclone with my PC, I prefer to run it manually. It might need to run before the rclone mount command, If so, try &&:
The && just ensures that the command after it will run only if the first one was successful. (In this case, if the export was successful.
Secondly, that password and variable is only necessary if you encrypted the configuration file, which I’ve done, as I’m a paranoid one. It’s not really necessary if your computer is in a safe environment. (Which mine is but, like I said, I’m paranoid.)
Also, that
usr/bin/rclone --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/
command of yours is missing a / in the beginning:
/usr/bin/rclone --vfs-cache-mode writes mount OneDrive: /home/dlynfox/OneDrive/
Apologies, just read your reply again. In the above command, you should actually specify the command for the --password-command echo “” parameter. Doing this will leave it blank.
You should instead of using a system-wide service use a per-user one instead.
You can create those under ~/.config/systemd/user/
Inside you can make use of %h as explained in systemd.unit(5) #Specifiers
PS: that way you won’t need to use User= nor Group= etc which makes it even cleaner…