martymac / fpart

Sort files and pack them into partitions
https://www.fpart.org/
BSD 2-Clause "Simplified" License
231 stars 39 forks source link

Incompatible option(s) detected within toolopts (option -o) #56

Closed jiamliang closed 11 months ago

jiamliang commented 11 months ago

I run the following command on debian 12 (same on another server): fpsync -n 15 -o "-a" /Dashi/source/ root@10.10.90.3:/Mariana/source/ message: Incompatible option(s) detected within toolopts (option -o)

fpart -V fpart v1.5.1 Copyright (c) 2011-2022 Ganael LAPLANCHE ganael.laplanche@martymac.org WWW: http://contribs.martymac.org Build options: debug=no, fts=system

rsync -V rsync version 3.2.7 protocol version 31 Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, symlinks, symtimes, hardlinks, hardlink-specials, hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs, xattrs, optional secluded-args, iconv, prealloc, stop-at, no crtimes Optimizations: SIMD-roll, no asm-roll, openssl-crypto, no asm-MD5 Checksum list: xxh128 xxh3 xxh64 (xxhash) md5 md4 sha1 none Compress list: zstd lz4 zlibx zlib none Daemon auth list: sha512 sha256 sha1 md5 md4

rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.

is there any sugguest ? Thanks a lot.

jiamliang commented 11 months ago

OK, i found this:

https://github.com/martymac/fpart/blob/f4611fef30cd854dbc4cf99c65ddfc023b516cac/tools/fpsync#L723 https://github.com/martymac/fpart/blob/f4611fef30cd854dbc4cf99c65ddfc023b516cac/tools/fpsync#L468

tool_uses_forbidden_option () {
    # For rsync, prevent usage of :
    # --delete
    # --recursive, -r
    # -a (implies -r)
    # and leave fpsync handle them internally.
    [ "$1" = "rsync" ] && \
        { printf '%s\n' "$2" | grep -q -- '--delete' || \
          printf '%s\n' "$2" | grep -q -- '--recursive' || \
          printf '%s\n' "$2" | grep -qE -- '(^|[[:space:]])-[^[:space:]-]*r' || \
          printf '%s\n' "$2" | grep -qE -- '(^|[[:space:]])-[^[:space:]-]*a' ;}
}

Thanks !