MongoDB monodump 成功但无法打开存档

MongoDB monodump succeeded but can't open the archive

我有一个脚本来备份我的 MongoDB。然而,脚本直到现在都运行良好。每次我 运行 脚本时,它都会说 "done dumping...(x documents)"。但是当我尝试从 FileZilla 访问它时,它说 /home/ubuntu/temp/bcd.gz: open for read: no such file or directory

/usr/bin/mongodump -h $HOST -d $DBNAME -u $USERNAME -p $PASSWORD --authenticationDatabase "admin" --gzip --archive=abc.gz /usr/bin/mongodump -h $HOST -d $DBNAME2 -u $USERNAME -p $PASSWORD --authenticationDatabase "admin" --gzip --archive=bcd.gz

我的第一个数据库总是正确备份,没有任何问题。问题始终与 $DBNAME2 有关。我正在使用的用户有 backup permission.

$DBNAME2 数据库有问题吗?如果是这样,我该如何解决?

显然在脚本中我的命令末尾有一个额外的字符 windows 没有显示它。我刚刚打开 Mac 上的脚本,看到多余的字符并将其删除。繁荣,成功了!