Run some command when specific error happened

What is the problem you are having with rclone?

I'm finding way to run some command when rclone makes some specific error.

I'm moving lot of files from "My Drive" to "Shared Drive" in Google Drive. There is a limit for number of files in one Shared drive so I should make new one when number of file reached to limit in Shared drive.

When it reached to limit, rclone shows the log about it but I don't know it since I'm not watching log realtime.

So I want to run a shell script that send a telegram message to me that alert it when error appeared but don't know how to do it.

Is there a way to run some script when specific error happened in rclone?

What is your rclone version (output from rclone version)

rclone v1.55.0

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.2
  • go/linking: static
  • go/tags: cmount

Which OS you are using and how many bits (eg Windows 7, 64 bit)

I'm using Ubuntu(Linux)

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone move source: remote: --drive-server-side-across-configs=true --drive-skip-shortcuts --delete-empty-src-dirs=true -P -v --retries 15 --transfers 20

have you tried using an exit code
and perhaps this