Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SshClient client = new SshClient(sshConnectionInfo))
- {
- client.Connect();
- //strCmd is:
- // mysqldump -h "<server>.dreamhosters.com" -u "<dbuser>" -p"<actual_password>" "<dbid>" > "/home/<user_name>/<temp_file_name>.sql"
- //
- // with <...> parts are obviously filled in with correct credentials
- SshCommand resCmd = client.RunCommand(strCmd);
- //Check result
- string strExpDesc = resCmd.Error;
- if (string.IsNullOrWhiteSpace(strExpDesc))
- {
- Console.WriteLine("Exported OK");
- }
- else
- {
- Console.WriteLine("Error: " + strExpDesc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement