--suffix parameter


#1

I am trying to set a suffix on the backup files by utilizing --suffix = date "+-%Y-%m-%d" on macOS where the remote is either Google and Onedrive. The problem is that rclone does not expand the suffix command, the suffix is set as the string above. If I paste the command in a terminal it expands to “-2018-12-28”… My question is:

  1. how to set the date string correct as --suffix parameter to get macOS to expand the suffix string as a date command…

#2

I’m assuming you want the output to be something like this as you have to put single ` around the command you want to escape out and run.

textere@seraph:~  date "+-%Y-%m-%d"
-2018-12-28
textere@seraph:~ echo blah` date "+-%Y-%m-%d" `
blah-2018-12-28

#3

I have tried that, does not work… I also put a space in between the hyphens…


#4

prezi4.pdfdate "+-%Y-%m-%d"

is an example of a backed up file…


#5

You need to put single backticks in the command as I shared in my output above.

So that would be:

textere@seraph:~ echo prezi4.pdf`date "+-%Y-%m-%d"`
prezi4.pdf-2018-12-28

Can you share specifically what your are typing and what the output is?


#6

this worked now… thx…

/Users/thomas/bin/rclone sync /Users/thomas/test/source local:/Users/thomas/test/dest --dry-run --verbose --backup-dir=local:/Users/thomas/test/dest_backup --suffix=date "+-%Y-%m-%d"


#7

I am utilizing the --suffix parameter in a Swift app (macOS app) and the arguments for the Process object in Swift does not expands shell commands. That caused the problem - and I have found a workaround by setting the date as suffix in the macos app when loading the app… not perfect, but i works…