# Can I skip or suppress errors for dangling shortcuts?

**URL:** <https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095>\
**Category:** Help and Support\
**Created:** [June 30, 2021, 9:35pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095 "2021-06-30T21:35:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chscott](https://forum.rclone.org/user_avatar/forum.rclone.org/chscott/32/8415_2.png) [@chscott](https://forum.rclone.org/u/chscott)\
**Post date:** [June 30, 2021, 9:35pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/1 "2021-06-30T21:35:22Z")

</div>

#### What is the problem you are having with rclone?

I am running rclone jobs to copy data from one remote to another, and I use the return code to determine success or failure. A small number of jobs are "failing" (i.e., the return code is non-zero) due to errors trying to copy dangling shortcuts. I don't expect to be able to copy anything useful when the file the shortcut points to is gone, so this error is a red herring that I want to ignore so those jobs complete successfully.

I see the `--drive-skip-shortcuts` option, but that presumably skips _all_ shortcuts. I just want to skip or suppress errors for _dangling_ shortcuts.

#### What is your rclone version (output from `rclone version`)

1.55.1

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

Windows 10, 64 bits

#### 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`)

```auto
rclone copy Source: Target: --drive-server-side-across-configs

```

#### A log from the command with the `-vv` flag

```auto
rclone copy Source: Target: --drive-server-side-across-configs
2021/06/30 08:03:15 ERROR : Shortcut Name: Failed to copy: object not found

rclone lsf Source:
2021/06/30 16:20:03 NOTICE: Dangling shortcut "Shortcut Name" detected

```

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [June 30, 2021, 9:55pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/2 "2021-06-30T21:55:24Z")

</div>

hi,

the problem is that relying on the error code alone, is that you have no idea what the error is.  
perhaps there is a serious error, perhaps just the shortcut error.

in my case, i have a script that i use to run rclone with a debug log.  
after rclone has completed, the script scans the log for errors and other text.  
it also can ignore certain text.

hope that sparks some ideas...

---

<div class="post-metadata">

**Author:** ![chscott](https://forum.rclone.org/user_avatar/forum.rclone.org/chscott/32/8415_2.png) [@chscott](https://forum.rclone.org/u/chscott)\
**Post date:** [June 30, 2021, 10:15pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/3 "2021-06-30T22:15:43Z")

</div>

I understand what you're saying, but I don't think I should need to grep a log for strings to ascertain the binary success/fail state of a job. That's the role of the status code. I also don't think the status code should be set to a non-zero for a benign condition that has no impact on the true success or failure of the job.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [June 30, 2021, 11:58pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/4 "2021-06-30T23:58:25Z")

</div>

From a binary perspective.

It tried to copy a file.  
It failed.  
That's not a successful job.

If you have dangling shortcuts, is that something you can clean up prior to the copy? Having a link go to nothing feels like a bad starting state as you'd get that with any copy tool.

```auto
felix@gemini:~/test$ cp * ../test1
cp: cannot stat 'blah': No such file or directory
felix@gemini:~/test$ echo $?
1

```

with a bad link on a regular copy command in Linux.

---

<div class="post-metadata">

**Author:** ![chscott](https://forum.rclone.org/user_avatar/forum.rclone.org/chscott/32/8415_2.png) [@chscott](https://forum.rclone.org/u/chscott)\
**Post date:** [July 1, 2021, 12:47am UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/5 "2021-07-01T00:47:57Z")

</div>

I understand what you're saying, but from a real-world perspective, that was a successful job in my world. We can agree to disagree on semantics.

Are you talking about using rclone in some new-to-me mode to identify and prune dangling shortcuts? Even if that's possible, I don't think I'd want that because I'm dealing with thousands of drives of unknown composition, many of which are quite large and heavily nested. Traversing those in a pre-copy pass would take forever.

I'd guess a --drive-skip-dangling-shortcuts option wouldn't work because I don't know if there's a way to identify a dangling shortcut before encountering the problem. But it seems like a flag to not treat that condition as an error would work.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [July 1, 2021, 12:56am UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/6 "2021-07-01T00:56:58Z")

</div>

> [@chscott](#):
>
> I understand what you're saying, but from a real-world perspective, that was a successful job in my world. We can agree to disagree on semantics.

I was just using your binary analogy as it isn't semantics in this case as a copy failed.

> [@chscott](#):
>
> `2021/06/30 08:03:15 ERROR : Shortcut Name: Failed to copy: object not found`

The reason is because a shortcut went nowhere. Why it failed would be the challenge as the reason (in your case), is not a valid reason for your use case. I get that and that's not debatable as your use case is 100% valid for you.

> [@chscott](#):
>
> Are you talking about using rclone in some new-to-me mode to identify and prune dangling shortcuts?

I'd assume if rclone can detect a dangling shortcut, it's scriptable and they can be removed.

> [@chscott](#):
>
> Even if that's possible, I don't think I'd want that because I'm dealing with thousands of drives of unknown composition, many of which are quite large and heavily nested. Traversing those in a pre-copy pass would take forever.

Sure, but if I'm expecting a backup and I have something missing, I'd want to know that as a broken sym link or in this case a shortcut that goes to nothing.

I'd suggest to just open a feature request and if it gets traction, it can be implemented.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [August 30, 2021, 8:57pm UTC](https://forum.rclone.org/t/can-i-skip-or-suppress-errors-for-dangling-shortcuts/25095/7 "2021-08-30T20:57:21Z")

</div>

Closed on August 30, 2021, 8:57pm UTC

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