Can i move my flags to config options?

rclone is great but my setup is feeling a little messy. Mostly i have scripts for each "operation". And they duplicate a lot.

I already had to learn new bash tricks to handle the many command line flags (actually proud of it and use this pattern of comment flags everywhere now :slight_smile: ), and now I was about to centralize them in a single file per remote... but then i realized: I may be underutilizing the config file!

here's a sample script (i have $provider-[pull|push|diffcheck].sh which ends up being some dozen files).

#!/bin/env bash

set -e

RCLONE=/usr/bin/rclone
RCLONEFLAGS=(
	# --dry-run
	--interactive

	--log-file b2push.log
	--color ALWAYS # doesn't seem to work with log-file :/
	--one-file-system # Don't cross filesystem boundaries
	# --update # Skip files that are newer on the destination (defeats SYNC purpose i guess?)
	--create-empty-src-dirs # be on the safe side of user-side-encryption crap
	--log-level INFO
	--check-first # do whatever before starting to transfer
	--ignore-checksum # Skip post copy check of checksums (i might regret this later, but for now, save some bandwidth)
	# --checksum # Check for changes with size & checksum (if available, or fallback to size only). (again, i might regret later. but save some bandwidth. or can the client get this directly from b2/s3/etc wout downloading the data?)
	# --b2-disable-checksum # Disable checksums for large (> upload cutoff) files (i guess this option answers my question above)
	--b2-hard-delete
	# --b2-copy-cutoff SizeSuffix # Cutoff for switching to multipart copy (default 4Gi)
	# --progress # show progress
	--metadata
	# --disable CaseInsensitive, DuplicateFiles, ReadMimeType, WriteMimeType, CanHaveEmptyDirectories, BucketBased, BucketBasedRootOK, SetTier, GetTier, ServerSideAcrossConfigs, IsLocal, SlowModTime, SlowHash, ReadMetadata, WriteMetadata, UserMetadata, FilterAware, PartialUploads, NoMultiThreading, Overlay, Purge, Copy, Move, DirMove, ChangeNotify, UnWrap, WrapFs, SetWrapper, DirCacheFlush, PublicLink, PutUnchecked, PutStream, MergeDirs, CleanUp, ListR, About, OpenWriterAt, OpenChunkWriter, UserInfo, Disconnect, Command, Shutdown
	--human-readable
	--fast-list
	--disable-http2
	--no-unicode-normalization
	--stats 30s # nothing seems to work when using log-file :/ tail -f it is
	--stats-file-name-length 0
	#--refresh-times # Refresh the modtime of remote files
	# --stats-log-level INFO # Log level to show --stats output DEBUG|INFO

	
	--exclude "ecryptfs.json"
        --exclude ".encfs6.xml"
	
)

RSYNC="${RCLONE} sync ${RCLONEFLAGS[@]}"

set -x

${RSYNC} /home/me/cloud/b2 b2:bucket1/some_dir

my gdrive one is even worse :slight_smile: and there are others. not even counting the crypt ones.

So, can i move these options to my rclone.conf?

global flags such as --log-level cannot be moved into config file

backend/remote flags such as --b2-hard-delete, can be moved into the config file as hard_delete

--b2-hard-delete was the only one that was already there because it is mentioned in the b2 guide.

So i'm out of luck for all the others? you mention globals... are "flags for copy/sync" also considered globals?

command flags cannot go into the config file, same as global.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.