VARBINARY
связан с 255 байтами в MySQL 5.0.2 и ниже, с 65kB в 5.0.3 и выше.
BLOB
связан с 65 кБ.
В конечном счете, VARBINARY
практически совпадает с BLOB
(с точки зрения того, что в нем может храниться), если только вы не хотите сохранить совместимость со «старыми» версиями MySQL. Документация MySQL гласит:
В большинстве случаев вы можете рассматривать столбец
BLOB
как столбецVARBINARY
, который может быть настолько большим, насколько вам нравится.
You should use ssh
in this way to execute scripts on remote machines,
ssh user@server exec /path/to/script/script.sh
where script.sh
is available on the server on the given path from the user
login.
If the script is not present on the server but available on your local machine (and you do not have common NFS shared space between the two machines), you should send the script with scp
like this,
scp script.sh user@server:/path/to/script/
Now, for your specific case of getting a server file you should just execute,
scp user@server:/path/to/file/filename .
like some other answers already suggest.
Кроме того, если вы не хотите, чтобы сценарий был доступен на удаленном сервере, попробуйте следующее:
ssh thehost 'cd /tmp; ls; echo Hello world, I am `hostname`'
и для копирования без SCP:
ssh localhost 'cat /bin/bash' > local_bash
ssh in a script doesn't work like that. However it does have the capability to execute a command on a remote server by specifying the command as an argument to ssh, like:
ssh brjones@server.com do_foo.sh
will run the do_foo.sh script on the server
However for your situation it looks like what you are really looking for is SCP.
Several people have already explained how to do the particular example you give better and easier.
If you really do need to script a remote interaction, you might consider using expect
.
Если вашей целью является только передача файлов, вам следует использовать scp. Но для выполнения некоторых команд на удаленном хосте без специального сценария на этом удаленном хосте вы можете просто использовать стандартный ввод, например:
!/bin/sh
ssh -o PreferredAuthentications=publickey brjones@server.com << EOT
cd ~/folder
echo "hello" > hello.txt
...
EOT