Skip to content

Nested Relative Symlinks in a Path Causing Error 23 #834

@HaroPo

Description

@HaroPo

Hi,

I just figured out why my rsync backups keep ending with error / exitcode 23:

I have a path where 2 relative symlinks are present.
If replacing one of them by an absolute path the error is gone.

The problem is that I need the relative path to be kept in order for everything to keep working when the folder structure is mounted via SSHFS on a different client system than the one I use for the backup.

Some "silly" example to be able to reproduce the problem:

/var/www/html/A/KB/IT/FS/ext4/index.php
/var/www/html/A/KB/IT/OS/GNU+Linux/Debian/index.php
/var/www/html/A/KB/IT/OS/GNU+Linux/Debian/FS <=> ln -rs -T "/var/www/html/A/KB/IT/FS/"  "FS"
/var/www/html/B/KB <=> ln -rs -T "/var/www/html/A/KB/"  "KB"

In this example, /var/www/html/B/KB will add up to /var/www/html/A/KB/IT/OS/GNU+Linux/Debian/FS and create a situation while it is resolved properly by "Nemo" files manager from "Linux Mint" (to mention what I used to visually check if anything missing as said by 'rsync').

It would be great if 'rsync' could just copy the links as they are instead of interpreting them.

Following are some real error messages for reference, in case my problem could be (I wish) just a configuration problem to perform the backup:

rsync: [generator] failed to set times on "/home/mint/backups/2025-12-30_@_00:31:42_UTC/var/www/html/pages/source/kb/it/os/linux/files_systems/fs": No such file or directory (2)

sent 1,328 bytes  received 150,610 bytes  3,132.74 bytes/sec
total size is 1,365,006,134  speedup is 8,983.97
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1865) [generator=3.2.7]

Thanks for reading this and, eventually have a look at it for us all. :-)

Best regards,
H.P.

[edit 2025-12-30 @ 00h42 (UTC)]
P.S.
Following is what can be found in my bash script for the job:

#!  /bin/bash
    server_ipaddrv4='123.123.123.123'
    user='user'
    date_now="`date +%Y-%m-%d_@_%H:%M:%S_UTC`"
    src="$user@$server_ipaddrv4:/var/www/html"
    dst="/home/$USER/website/backups/$date_now"

#   rsync  -e ssh  -var -Hl        --safe-links         "$src"   "$dst/."
#   rsync  -e ssh  -var -Hl        --munge-links        "$src"   "$dst/."
#   rsync  -e ssh  -var -Hl        --copy-unsafe-links  "$src"   "$dst/."
    rsync  -e ssh  -var -H --links --copy-unsafe-links  "$src"   "$dst/."
    exitcode=$?

    if  [ $exitcode -eq 0 ]
    then
        cd "$dst/.."
        ln  -sf  -T  "$dst"  "latest_server_backup   -->"
    else
        mv  "$dst"  "${dst}_FAILED_"
    fi

    echo    ""
    read    -p  "Press [Enter] to continue..."

exit  $exitcode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions