Log file creation if job = success


I run this command and not 100% shure of log file creation:

rclone copy /volume1/work/ jotta:work --no-unicode-normalization --progress --log-file=work

Is this only making a log file if there is some errors?

If this is true, what switches should I use to add some status in the log file if rclone job is a success?


if you use --log-file, then rclone will always try to create the log file.
in some cases, where the command itself is not valid syntax, no log file is created.

there are not such flags.
you could check the exit code, same as any app, as documented at https://rclone.org/docs/#exit-code

this example is a valid command and so the exit code is 0

root@hetz04:~# rclone version
rclone v1.62.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-76-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none
root@hetz04:~# echo $?

this example is not a valid command, so the exit code is non-zero

root@hetz04:~# rclone mistake
Error: unknown command "mistake" for "rclone"
Run 'rclone --help' for usage.
You could use 'rclone selfupdate' to get latest features.

2023/07/26 11:00:44 Fatal error: unknown command "mistake" for "rclone"
root@hetz04:~# echo $?

note: could try to parse the log file but should not rely on that.
some apps such as 7zip, add append text such as Everything is Ok, but rclone does not

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