You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Storing defaults for global flags in the config file (profiles) #2697
In the rclone config file have configuration for "profiles". These are default settings for all the rclone flags.
So the flag "--delete-during" would be stored like this in the config in the default profile.
[:default]
delete_during = true
Rclone would provide the --profile flag to use a different profile and provide rclone config profile to edit the profile with a config profile editor wizard.
Backend flags should be settable in the profile also - basically any flag that rclone has should be settable in the profile (just like it is settable in the environment already).
Extension idea: could inherit from other profiles.
Reacted by la0wei, Michał Drzał, archont00, 𝙃𝘼𝙍𝙍𝙔, Daniel Dinu, azrdev, YenForYang, Leroy Förster, Ivan Andreev, Kevin Hanselman and 28 more
@ncw I took a stab at implementing this. It's still a WIP but if you have a moment, it would be very helpful if you could take a peek and let me know if I'm on the right track: nielash@60b9568
Features:
save a profile while running any other command by adding --save-profile NAME
use one or more profiles with a command by adding --use-profile NAME1,NAME2,NAME3...
--profile-include-args to include the command's args in addition to flags (for example, two long paths that you sync regularly)
Support for inheriting settings from multiple nested "parent" profiles
Support for setting one "default" profile in the config, for use cases where users can't set --use-profile from command line flags or env vars
new dedicated setprofile command
new dedicated profiles wizard UI in rclone config profile
I took a stab at implementing this. It's still a WIP but if you have a moment, it would be very helpful if you could take a peek and let me know if I'm on the right track: nielash@60b9568
Very nice list of features :-) You've done a very thorough job.
This is going to need lots of docs!
I did also have the idea that we could introduce global flags to set when using a backend. So when you do
[myremote]
type = s3
whatever = blah
--inplace = true
This would set the --inplace flag which would be rather like using --profile myremote if you see what I mean.
So if we could arrange for the profile settings and the flag settings not to clash then we can enable this if we want.
Looking at the code you are using type = profile to tell the profiles apart from backends which seems sensible.
save a profile while running any other command by adding --save-profile NAME
Very nice feature!
use one or more profiles with a command by adding --use-profile NAME1,NAME2,NAME3...
This should probably just be --profile (eg the aws command).
--profile-include-args to include the command's args in addition to flags (for example, two long paths that you sync regularly)
This should probably default to true - if you put args in the profile then you'd expect to use them.
Support for inheriting settings from multiple nested "parent" profiles
How do you do that - I missed that in the code.
This could potentially be the mechanism for including a profile in a backend definition rather than including the flags directly.
Support for setting one "default" profile in the config, for use cases where users can't set --use-profile from command line flags or env vars
new dedicated setprofile command
new dedicated profiles wizard UI in rclone config profile
docs - this needs some really clear docs on how to use profiles, how they work, how they appear in the config file, how to edit them etc. This should be a section in docs.md and what we can do is run that by the users on the forum along with a link to a beta to get some feedback.
can you try to break the commit up into smaller chunks for easier review please :-)
we probably should have some API to do stuff with profiles, though maybe the existing config api will work
Very nice work :-)
Reacted by nielash, Kevin Hanselman, Leo Breuss and FeralFlora
Support for inheriting settings from multiple nested "parent" profiles
How do you do that - I missed that in the code.
In the config they are saved as a comma-separated list under the parent_profiles key, and then the p.Use method calls p.useParents, which eventually calls p.Use on each of those parents, which means doing the same for all of their parents, if any (grandparents), recursively until it runs out of ancestors to "use" 😆
The priority of conflicting settings is resolved in an order of lowest to highest, with parents all lower than child. (In other words, think of parents as a set of defaults that are inherited but can be overridden at will.)
I did also have the idea that we could introduce global flags to set when using a backend.
I like this idea a lot. It is sort of already possible with the --profile-include-args implementation in the current draft. In other words, if you have this config:
[myremote]
type = s3
whatever = blah
[s3]
type = profile
inplace = true
arg_2 = myremote:
then rclone copy some:path --use-profile s3 should be equivalent to rclone copy some:path myremote: --inplace
(arg_2 as presumably the dest is what you care about with --inplace)
But this does have some drawbacks -- you'd need to know in advance which arg number it would be, and it is also not very flexible if you want to use some other path at that remote.
Tying global flags to remotes is a really interesting idea and I agree it would be useful. One question I have though is how conflicting flags would be handled in commands that use more than one remote. For example, suppose I sync two remotes, one of which has --checkers=8, the other of which has --checkers=16. How many checkers would be used for the sync? Another question to ponder: what if the src specifies dest-related flags like --inplace but the dest is silent on that flag -- is it used or ignored?
Another possible implementation to consider: what if an Fs remote could take an optional profile parameter to call p.Use maybe during NewFs? Then the profiles code doesn't have to be concerned with going into other config sections and parsing them directly -- it is more of a pointer to where the settings are defined. Maybe that is what you were getting at with the parent profiles idea.
I'll give this more thought, as I agree it would be quite handy! (A use that comes up for me a lot is wanting to use -c with backends that support checksums but omit it otherwise, to avoid the fallback to --size-only. It would be nice to be able to just put that -c in the config!)
This is going to need lots of docs!
Absolutely! That's a given.
This should probably just be --profile (eg the aws command).
I agree. I'll change it in the next draft.
--profile-include-args to include the command's args in addition to flags (for example, two long paths that you sync regularly)
This should probably default to true - if you put args in the profile then you'd expect to use them.
My slight hesitation about this is that I'm not sure if that assumption also holds true when saving a profile. For example, if I do:
would you expect that to save the paths too? Or just -MvP --create-empty-src-dirs? If we reversed the default, would you have to do --profile-no-args to save only the flags?
Rename --profile-include-args -> --profile-save-args (now save-only - saved args apply automatically at use time).
All four flags now share the --profile* namespace.
RCLONE_PROFILE=NAME env var now works
Removed the [default_profile] magic section - users set RCLONE_PROFILE or use a shell alias instead.
Added rclone config profile save / list / show / delete subcommands.
Dropped the top-level rclone setprofile command.
Profile sections now live under [profile:NAME] namespace (uses : which is illegal in remote names).
Dropped the type = profile field
Profile sections filtered out of listremotes, the config wizard's remote picker, and the rc /config/dump endpoint.
A remote [backup] and a profile [profile:backup] now coexist without conflict; checkNameConflict removed.
Dropped the fake fs.Register({Name:"profile", NewFs: nope, …}) pseudo-backend.
Dropped the profileConfig state machine and EditProfiles interactive wizard.
In-memory Profile.Flags keys are now canonical snake_case
Replaced the ~600 lines of cmd.Root/bisync/fstest scaffolding with unit tests against a small synthetic *cobra.Command.
New "Profiles" section in docs/content/docs.md
Here are the updated docs
Profiles {#profiles}
Profiles let you save a named set of flags (and optionally arguments)
in the config file and reuse them on later command lines, so you
don't have to retype long flag combinations every time.
For example, if you regularly sync a directory to Google Drive with a
specific set of flags, you can save that combination once as a
profile and from then on use --profile mybackup instead.
Saving a profile
Add --profile-save NAME to any rclone command. The command will run
as normal, and rclone will additionally write all the explicitly-set
flags from that command line into the config file under a new section
named [profile:NAME]. The profile: prefix is the namespace
profiles live in - because : is illegal in remote names, a profile
called backup and a remote called backup can coexist without
colliding.
Only flags whose values you explicitly changed are saved - flags left
at their default are not.
The profile-control flags themselves (--profile-save, --profile, --profile-save-args, --profile-strict-flags) are never saved
into the profile. --config is also excluded - it's
environment-specific and would re-point the config storage mid-load
when applied from a profile.
Using a profile
Add --profile NAME to apply a saved profile:
rclone sync src: dst: --profile fast-sync
This is equivalent to repeating all the flags from the saved profile
on the command line.
You can apply several profiles in one go by passing a comma-separated
list. They are applied in lowest-to-highest priority order, so later
profiles override earlier ones:
rclone sync src: dst: --profile common,fast-sync
Any flag you pass explicitly on the command line overrides the
profile's value for that flag, so you can use a profile as a baseline
and tweak individual values for one run.
For safety, a profile can never turn off --dry-run if it was set
explicitly on the command line.
Including command arguments
By default --profile-save only saves flags. If you also want to
save the positional arguments (e.g. the source and destination paths)
add --profile-save-args:
When the profile is later used, saved arguments are applied
automatically - you don't need to pass anything extra at use time.
If you pass your own positional arguments on the command line, they
take precedence over the profile's saved ones (the profile only
fills slots you didn't provide).
Strict flag checking
When you save a profile from one command (say sync) and then apply
it to another (say copy), the profile may contain flags that don't
exist on the new command. By default these flags are silently
ignored. Pass --profile-strict-flags to make rclone error out
instead of skipping them.
Command-specific flags
Profiles work with the flag set of the command they're saved from
and applied to, so command-specific flags (e.g. the VFS
flags on rclone mount, or
bisync's --resilient) are saved and loaded just like global flags:
rclone mount remote: /mnt --vfs-cache-mode full --dir-cache-time 24h \
--profile-save media-mount
rclone mount remote: /mnt --profile media-mount
The resulting section looks like any other profile:
[profile:media-mount]vfs_cache_mode = full
dir_cache_time = 24h0m0s
If you later apply this profile to a different command that doesn't
have those flags (e.g. rclone copy --profile media-mount), the
VFS flags are silently skipped - or rejected if you also pass --profile-strict-flags.
To build a profile for command-specific flags without actually
running the command, use rclone config profile save NAME --flags-from CMD:
rclone config profile save media-mount --flags-from mount \
--vfs-cache-mode full --dir-cache-time 24h
Inheriting from parent profiles
A profile can inherit settings from one or more parent profiles by
listing them in parent_profiles in the config:
Parent names are also given in their user-facing form (without the profile: prefix).
Using --profile nightly first applies shared, then applies nightly on top, so nightly overrides any flag the two have in
common. Parents themselves can have parents - profiles are resolved
recursively.
Always applying a profile
There is no "default profile" mechanism - if you want a profile to
apply every time, set it in the environment instead:
export RCLONE_PROFILE=mybackup
--profile is exposed as a standard rclone option, so the RCLONE_PROFILE environment variable Just Works. Use a shell
alias or wrapper script if you want different defaults in different
contexts. This keeps "what flags am I actually running with" answerable
from the command line and environment alone, with no spooky action
from the config file.
Managing profiles
Use the rclone config profile subcommands to manage profiles
without editing the config file by hand:
rclone config profile save NAME [args...] [flags...]
rclone config profile list
rclone config profile show NAME
rclone config profile delete NAME
save writes a new profile from the flags (and optional positional
args, with --profile-save-args) given on the command line.
Pass --flags-from CMD[,CMD...] to make flags from other commands
(e.g. mount, bisync) available for saving without having to
actually run those commands.
list prints the names of all profiles in the config file.
show prints the keys and values stored in one profile.
delete removes a profile.
To edit an existing profile, either re-save it (overwriting the old
one) or edit the corresponding [profile:NAME] section in the
config file by hand.
Config file layout
Profiles live under the [profile:NAME] namespace in the config
file. The profile: prefix is the canonical signal that a section
is a profile - : is illegal in remote names, so profiles and
remotes can share a name without colliding. Profile sections are
hidden from rclone listremotes, rclone config show <remote> and
the rc API's config/dump (they don't appear as remotes).
Saved flags are written with their option name in snake_case (e.g. drive-skip-gdocs becomes drive_skip_gdocs = true). Saved
arguments are written as arg_1 = ..., arg_2 = ... and so on.
Reacted by nielash, Evan Patterson, Diana, Anagh Kumar Baranwal, musjj and Ramazan Aktolu
Removed the [default_profile] magic section - users set RCLONE_PROFILE or use a shell alias instead.
I slightly question this one... it was intended for a specific use case where the user has access to the config file but not env vars or command line flags. There is an example earlier in this thread, and it's a scenario that could start to become more common with the increasing number of "Rclone GUI" wrapper apps that seem to be popping up lately.
On the other hand, perhaps the better answer is for those apps to allow selecting a profile to use!
Thank you for reviving this! Haven't tested it out yet, but at a quick glance the changes look great!
Removed the [default_profile] magic section - users set RCLONE_PROFILE or use a shell alias instead.
I slightly question this one... it was intended for a specific use case where the user has access to the config file but not env vars or command line flags. There is an example earlier in this thread, and it's a scenario that could start to become more common with the increasing number of "Rclone GUI" wrapper apps that seem to be popping up lately.
The implementation was a bit too magic for my taste with one profile referencing another. Maybe we should just have a profile called default instead?
On the other hand, perhaps the better answer is for those apps to allow selecting a profile to use!
I was thinking about this feature in general in relation to the arg_N feature. We don't allow storing of the command running (eg ls or mount) which I think is a good decision, but it means that there will always be some arguments.
So at minimum a command is going to be rclone copy --profile myprofile
If we have default profile then that could be rclone copy
If we allowed storing the command too then that could be rclone.
I don't think we should allow storing the command, but would be interested to hear what you think.
I'm playing around with it now and think I found a small bug relating to command-specific flags.
Those should be fixed now!
Also an oddity with the --verbose flag.
That is fixed also.
That was to do with applying the flags twice which brings up another problem with flags you can repeat - eg --header. These also don't round trip to and from the config file - maybe we should just disallow them for the moment?
The implementation was a bit too magic for my taste with one profile referencing another. Maybe we should just have a profile called default instead?
I think that's a reasonable solution.
I don't think we should allow storing the command, but would be interested to hear what you think.
I agree about not storing the command.
I think the use case for the default profile (and perhaps someone here who actually needs it can articulate it better) is something like a GUI wrapper app that hardcodes something like rclone copy a: b:, with a: and b: referencing the user-supplied config. If you wanted to add filters or something, you'd have to somehow set them in the config, as the env vars and flags are hardcoded. I don't think the user would be looking to override the command itself.
Those should be fixed now!
Yay!
That was to do with applying the flags twice which brings up another problem with flags you can repeat - eg --header. These also don't round trip to and from the config file - maybe we should just disallow them for the moment?
I wouldn't necessarily miss --header but there are others I probably would miss, like --filter. What about the solution I proposed here?
Hey @ncw, should I open a new issue for the problem with the --profile argument when using serve mentioned here, or do you think it won't be necessary?
It seems that the --profile argument might not even be needed once the default profile implementation is complete.
Activity
harryqt commentedon Oct 25, 2019
I would also love to see this. But judging by the milestone shifting I'm guessing it's hard to implement?
ncw commentedon Oct 26, 2019
So much to do, so little time :-)
It isn't particularly tricky - fancy helping out?
41 remaining items
nielash commentedon Jan 12, 2024
@ncw I took a stab at implementing this. It's still a WIP but if you have a moment, it would be very helpful if you could take a peek and let me know if I'm on the right track: nielash@60b9568
Features:
--save-profile NAME--use-profile NAME1,NAME2,NAME3...--profile-include-argsto include the command's args in addition to flags (for example, two long paths that you sync regularly)--use-profilefrom command line flags or env varssetprofilecommandrclone config profileThere are a number of (passing!) tests here that show the intended use:
https://github.com/nielash/rclone/blob/profiles-WIP/fs/config/configprofiles/profiles_test.go
ncw commentedon Feb 2, 2024
@nielash
Very nice list of features :-) You've done a very thorough job.
This is going to need lots of docs!
I did also have the idea that we could introduce global flags to set when using a backend. So when you do
This would set the
--inplaceflag which would be rather like using--profile myremoteif you see what I mean.So if we could arrange for the profile settings and the flag settings not to clash then we can enable this if we want.
Looking at the code you are using
type = profileto tell the profiles apart from backends which seems sensible.Very nice feature!
This should probably just be
--profile(eg theawscommand).This should probably default to true - if you put args in the profile then you'd expect to use them.
How do you do that - I missed that in the code.
This could potentially be the mechanism for including a profile in a backend definition rather than including the flags directly.
All good!
Nice!
I think what this needs next is
docs.mdand what we can do is run that by the users on the forum along with a link to a beta to get some feedback.Very nice work :-)
nielash commentedon Feb 3, 2024
Very helpful feedback -- thank you!
In the config they are saved as a comma-separated list under the
parent_profileskey, and then thep.Usemethod callsp.useParents, which eventually callsp.Useon each of those parents, which means doing the same for all of their parents, if any (grandparents), recursively until it runs out of ancestors to "use" 😆The priority of conflicting settings is resolved in an order of lowest to highest, with parents all lower than child. (In other words, think of parents as a set of defaults that are inherited but can be overridden at will.)
This test shows it in action.
I like this idea a lot. It is sort of already possible with the
--profile-include-argsimplementation in the current draft. In other words, if you have this config:then
rclone copy some:path --use-profile s3should be equivalent torclone copy some:path myremote: --inplace(
arg_2as presumably the dest is what you care about with--inplace)But this does have some drawbacks -- you'd need to know in advance which arg number it would be, and it is also not very flexible if you want to use some other path at that remote.
Tying global flags to remotes is a really interesting idea and I agree it would be useful. One question I have though is how conflicting flags would be handled in commands that use more than one remote. For example, suppose I sync two remotes, one of which has
--checkers=8, the other of which has--checkers=16. How many checkers would be used for the sync? Another question to ponder: what if the src specifies dest-related flags like--inplacebut the dest is silent on that flag -- is it used or ignored?Another possible implementation to consider: what if an Fs remote could take an optional
profileparameter to callp.Usemaybe duringNewFs? Then the profiles code doesn't have to be concerned with going into other config sections and parsing them directly -- it is more of a pointer to where the settings are defined. Maybe that is what you were getting at with the parent profiles idea.I'll give this more thought, as I agree it would be quite handy! (A use that comes up for me a lot is wanting to use
-cwith backends that support checksums but omit it otherwise, to avoid the fallback to--size-only. It would be nice to be able to just put that-cin the config!)Absolutely! That's a given.
I agree. I'll change it in the next draft.
My slight hesitation about this is that I'm not sure if that assumption also holds true when saving a profile. For example, if I do:
would you expect that to save the paths too? Or just
-MvP --create-empty-src-dirs? If we reversed the default, would you have to do--profile-no-argsto save only the flags?HorseLuke commentedon Feb 22, 2024
@nielash Does it support stringArray in your implements? Some config flags can be passed multiple, eg
--exclude,--ca-cert. Example: https://forum.rclone.org/t/rclone-exclude-not-working-for-multiple-rules/35200nielash commentedon Feb 23, 2024
Very good point! Yes, it should be supported, however it would be merged into one key in the config. For example:
would become:
The reason is because if you did this:
it would be invalid INI (can't have duplicate keys in the same section)
ncw commentedon May 13, 2026
I have revived @nielash original code for this and given it a polish - any testing and comments much appreciated
v1.75.0-beta.9733.5d3ed12fa.fix-2697-profiles on branch fix-2697-profiles (uploaded in 15-30 mins)
Changes from the original
--use-profile->--profile--save-profile->--profile-save--profile-include-args->--profile-save-args(now save-only - saved args apply automatically at use time).--profile*namespace.RCLONE_PROFILE=NAMEenv var now works[default_profile]magic section - users setRCLONE_PROFILEor use a shell alias instead.rclone config profile save / list / show / deletesubcommands.rclone setprofilecommand.[profile:NAME]namespace (uses:which is illegal in remote names).type = profilefieldlistremotes, the config wizard's remote picker, and the rc/config/dumpendpoint.[backup]and a profile[profile:backup]now coexist without conflict;checkNameConflictremoved.fs.Register({Name:"profile", NewFs: nope, …})pseudo-backend.profileConfigstate machine andEditProfilesinteractive wizard.Profile.Flagskeys are now canonical snake_casecmd.Root/bisync/fstestscaffolding with unit tests against a small synthetic*cobra.Command.docs/content/docs.mdHere are the updated docs
Profiles {#profiles}
Profiles let you save a named set of flags (and optionally arguments)
in the config file and reuse them on later command lines, so you
don't have to retype long flag combinations every time.
For example, if you regularly sync a directory to Google Drive with a
specific set of flags, you can save that combination once as a
profile and from then on use
--profile mybackupinstead.Saving a profile
Add
--profile-save NAMEto any rclone command. The command will runas normal, and rclone will additionally write all the explicitly-set
flags from that command line into the config file under a new section
named
[profile:NAME]. Theprofile:prefix is the namespaceprofiles live in - because
:is illegal in remote names, a profilecalled
backupand a remote calledbackupcan coexist withoutcolliding.
For example:
writes:
Only flags whose values you explicitly changed are saved - flags left
at their default are not.
The profile-control flags themselves (
--profile-save,--profile,--profile-save-args,--profile-strict-flags) are never savedinto the profile.
--configis also excluded - it'senvironment-specific and would re-point the config storage mid-load
when applied from a profile.
Using a profile
Add
--profile NAMEto apply a saved profile:This is equivalent to repeating all the flags from the saved profile
on the command line.
You can apply several profiles in one go by passing a comma-separated
list. They are applied in lowest-to-highest priority order, so later
profiles override earlier ones:
Any flag you pass explicitly on the command line overrides the
profile's value for that flag, so you can use a profile as a baseline
and tweak individual values for one run.
For safety, a profile can never turn off
--dry-runif it was setexplicitly on the command line.
Including command arguments
By default
--profile-saveonly saves flags. If you also want tosave the positional arguments (e.g. the source and destination paths)
add
--profile-save-args:When the profile is later used, saved arguments are applied
automatically - you don't need to pass anything extra at use time.
If you pass your own positional arguments on the command line, they
take precedence over the profile's saved ones (the profile only
fills slots you didn't provide).
Strict flag checking
When you save a profile from one command (say
sync) and then applyit to another (say
copy), the profile may contain flags that don'texist on the new command. By default these flags are silently
ignored. Pass
--profile-strict-flagsto make rclone error outinstead of skipping them.
Command-specific flags
Profiles work with the flag set of the command they're saved from
and applied to, so command-specific flags (e.g. the VFS
flags on
rclone mount, orbisync's
--resilient) are saved and loaded just like global flags:rclone mount remote: /mnt --vfs-cache-mode full --dir-cache-time 24h \ --profile-save media-mount rclone mount remote: /mnt --profile media-mountThe resulting section looks like any other profile:
If you later apply this profile to a different command that doesn't
have those flags (e.g.
rclone copy --profile media-mount), theVFS flags are silently skipped - or rejected if you also pass
--profile-strict-flags.To build a profile for command-specific flags without actually
running the command, use
rclone config profile save NAME --flags-from CMD:rclone config profile save media-mount --flags-from mount \ --vfs-cache-mode full --dir-cache-time 24hInheriting from parent profiles
A profile can inherit settings from one or more parent profiles by
listing them in
parent_profilesin the config:Parent names are also given in their user-facing form (without the
profile:prefix).Using
--profile nightlyfirst appliesshared, then appliesnightlyon top, sonightlyoverrides any flag the two have incommon. Parents themselves can have parents - profiles are resolved
recursively.
Always applying a profile
There is no "default profile" mechanism - if you want a profile to
apply every time, set it in the environment instead:
export RCLONE_PROFILE=mybackup--profileis exposed as a standard rclone option, so theRCLONE_PROFILEenvironment variable Just Works. Use a shellalias or wrapper script if you want different defaults in different
contexts. This keeps "what flags am I actually running with" answerable
from the command line and environment alone, with no spooky action
from the config file.
Managing profiles
Use the
rclone config profilesubcommands to manage profileswithout editing the config file by hand:
savewrites a new profile from the flags (and optional positionalargs, with
--profile-save-args) given on the command line.Pass
--flags-from CMD[,CMD...]to make flags from other commands(e.g.
mount,bisync) available for saving without having toactually run those commands.
listprints the names of all profiles in the config file.showprints the keys and values stored in one profile.deleteremoves a profile.To edit an existing profile, either re-save it (overwriting the old
one) or edit the corresponding
[profile:NAME]section in theconfig file by hand.
Config file layout
Profiles live under the
[profile:NAME]namespace in the configfile. The
profile:prefix is the canonical signal that a sectionis a profile -
:is illegal in remote names, so profiles andremotes can share a name without colliding. Profile sections are
hidden from
rclone listremotes,rclone config show <remote>andthe rc API's
config/dump(they don't appear as remotes).Saved flags are written with their option name in snake_case (e.g.
drive-skip-gdocsbecomesdrive_skip_gdocs = true). Savedarguments are written as
arg_1 = ...,arg_2 = ...and so on.nielash commentedon May 13, 2026
This is so exciting!!!
I slightly question this one... it was intended for a specific use case where the user has access to the config file but not env vars or command line flags. There is an example earlier in this thread, and it's a scenario that could start to become more common with the increasing number of "Rclone GUI" wrapper apps that seem to be popping up lately.
On the other hand, perhaps the better answer is for those apps to allow selecting a profile to use!
Thank you for reviving this! Haven't tested it out yet, but at a quick glance the changes look great!
nielash commentedon May 14, 2026
I'm playing around with it now and think I found a small bug relating to command-specific flags.
The docs suggest that this should work:
But for me it results in:
Similarly:
gives:
Same command omitting
--create-empty-src-dirsworks as expected.nielash commentedon May 14, 2026
Also an oddity with the
--verboseflag.shows
DEBUGlogs, when I would expectINFO.ncw commentedon May 21, 2026
:-)
The implementation was a bit too magic for my taste with one profile referencing another. Maybe we should just have a profile called
defaultinstead?I was thinking about this feature in general in relation to the arg_N feature. We don't allow storing of the command running (eg
lsormount) which I think is a good decision, but it means that there will always be some arguments.So at minimum a command is going to be
rclone copy --profile myprofileIf we have default profile then that could be
rclone copyIf we allowed storing the command too then that could be
rclone.I don't think we should allow storing the command, but would be interested to hear what you think.
Those should be fixed now!
That is fixed also.
That was to do with applying the flags twice which brings up another problem with flags you can repeat - eg
--header. These also don't round trip to and from the config file - maybe we should just disallow them for the moment?nielash commentedon May 23, 2026
I think that's a reasonable solution.
I agree about not storing the command.
I think the use case for the
defaultprofile (and perhaps someone here who actually needs it can articulate it better) is something like a GUI wrapper app that hardcodes something likerclone copy a: b:, witha:andb:referencing the user-supplied config. If you wanted to add filters or something, you'd have to somehow set them in the config, as the env vars and flags are hardcoded. I don't think the user would be looking to override the command itself.Yay!
I wouldn't necessarily miss
--headerbut there are others I probably would miss, like--filter. What about the solution I proposed here?nicollasricas commentedon Jul 25, 2026
Hey @ncw, should I open a new issue for the problem with the
--profileargument when usingservementioned here, or do you think it won't be necessary?It seems that the
--profileargument might not even be needed once the default profile implementation is complete.Add named profiles for saving flags and arguments - fixes rclone#2697