Rsync syntax error when run from bash script

后端 未结 3 1220
日久生厌
日久生厌 2020-12-07 04:24

I have been working on a backup script that uses rsync to do an incremental backup.

I have tested the following rsync command manually, and it runs and completes a b

3条回答
  •  我在风中等你
    2020-12-07 04:45

    This:

    rsync "$OPT1 $SRC $TRG"
    

    passes all your intended arguments lumped together as one argument, which rsync doesn't know how to deal with.

    Try this instead:

    rsync ${OPT1} ${SRC} ${TRG}
    

提交回复
热议问题