ssh multiple commands appends question mark to file name

笑着哭i 提交于 2019-12-02 14:30:55

问题


I have a database transfer script, which uses bzip2 to minimise locking of large databases on a server.

First line is

ssh root@server "mysqldump db | bzip2 >/root/db.sql.bz2"

This works on many servers, but on a new Ubuntu 14.04 server the file created on the server has a question mark appended:

ls -la gt*
-rw-r--r-- 1 root root 2364190 Nov 21 00:25 db.sql.bz2?

Any idea why this may be happening?


回答1:


Does your script have CR+LF line-endings? Make sure to use Unix (LF) line endings.



来源:https://stackoverflow.com/questions/27052212/ssh-multiple-commands-appends-question-mark-to-file-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!