Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--append-verify option does not work if destination file is symlink with the same name #650

Open
KES777 opened this issue Oct 16, 2024 · 0 comments

Comments

@KES777
Copy link

KES777 commented Oct 16, 2024

sudo rsync -e "ssh -v -i /key" -i --delete -xaXAv --copy-devices -D --append-verify --partial --inplace --progress /dev/sdc 'user@IP:/path/sdc'

The device size is around 2TB, only ~700Gb was copied and upload was interrupted.

+ sudo rsync -e 'ssh -v -i /key' -i --delete -xaXAv --copy-devices -D --append-verify --partial --inplace --progress /dev/sdc 'user@IP:/path/sdc'
OpenSSH_7.6p1 Ubuntu-4ubuntu0.7, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to IP.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /key type 0
debug1: key_load_public: No such file or directory
debug1: identity file /key type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.10
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.10 pat OpenSSH* compat 0x04000000
debug1: Authenticating to IP as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:rWALoneYnCm+kPbU6RwT7JihyY4C8TBuKGZEJsRxjJo
debug1: Host 'IP' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: kex_input_ext_info: [email protected] (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:/lsv49OK5zD5IBA6W0dRNSsUcDu01VAfD8VWm4akhxo /key
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug1: Authentication succeeded (publickey).
Authenticated to IP
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Remote: /xxx:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /xxx:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: Sending env LC_MEASUREMENT = uk_UA.UTF-8
debug1: Sending env LC_PAPER = uk_UA.UTF-8
debug1: Sending env LC_MONETARY = uk_UA.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_NAME = uk_UA.UTF-8
debug1: Sending env LC_ADDRESS = uk_UA.UTF-8
debug1: Sending env LC_NUMERIC = uk_UA.UTF-8
debug1: Sending env LC_MESSAGES = en_US.UTF-8
debug1: Sending env LC_TELEPHONE = uk_UA.UTF-8
debug1: Sending env LC_IDENTIFICATION = uk_UA.UTF-8
debug1: Sending env LC_TIME = en_US.UTF-8
debug1: Sending command: rsync --server -vlogDtpAXrxe.iLsfxC --log-format=%i --delete --append --append --copy-devices . /path/sdc
sending incremental file list
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3540, received 3164 bytes, in 1.3 seconds
Bytes per second: sent 2769.4, received 2475.3
debug1: Exit status 0

sent 57 bytes  received 12 bytes  19.71 bytes/sec
total size is 0  speedup is 0.00

The same happened with --append.

I suppose this happens because rsync checks /path/sdc which is symlink. It is less in size than the destination file thus rsync exits.

I expect that /path/sdc/sdc should be checked instead of /path/sdc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant