s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

Non regular files break `cp` even if they are excluded

Open MqllR opened this issue 1 year ago • 0 comments

If a non-regular file exists in a directory and we try to cp, s5cmd will exit with an error. This is true even if we exclude that non-regular file.

Example:

ls -la /tmp/test/
total 172
drwxrwxr-x  4 mql  mql    4096 Dec 10 14:01 .
drwxrwxrwt 26 root root 159744 Dec 10 14:02 ..
drwx------  5 mql  root   4096 Dec 10 14:01 geth
srw-------  1 mql  root      0 Dec 10 14:01 geth.ipc
drwx------  2 mql  root   4096 Dec 10 14:01 keystore

Then cp:

s5cmd cp --exclude "*.ipc" /tmp/test/ s3://mybucket/
ERROR "cp --exclude=*.ipc /tmp/test/ s3://mybucket/": object '/tmp/test/geth.ipc' is not a regular file
cp ...

Expected behavior is that s5cmd won't consider this unix socket file.

MqllR avatar Dec 10 '24 13:12 MqllR