Differences
This shows you the differences between the selected revisions of the page.
2017-10-04 | 2017-10-04 | ||
using variable expansion in strings in powershell (martin) | code wrapping for new design (martin) | ||
Line 54: | Line 54: | ||
UserName = "user", | UserName = "user", | ||
Password = "mypassword", | Password = "mypassword", | ||
- | SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..." |
}; | }; | ||
Line 62: | Line 62: | ||
session.Open(sessionOptions); | session.Open(sessionOptions); | ||
- | // Execute mysqldump on the server to dump all MySQL databases and compress the results | + | // Execute mysqldump on the server to dump all MySQL databases and |
+ | // compress the results | ||
const string dbUsername = "USERNAME"; | const string dbUsername = "USERNAME"; | ||
const string dbPassword = "PASSWORD"; | const string dbPassword = "PASSWORD"; | ||
Line 68: | Line 69: | ||
string dumpCommand = | string dumpCommand = | ||
- | string.Format("mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", | + | string.Format( |
- | ·································dbUsername, dbPassword, tempFilePath); | + | ························"mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", |
+ | ·······················dbUsername, dbPassword, tempFilePath); | ||
session.ExecuteCommand(dumpCommand).Check(); | session.ExecuteCommand(dumpCommand).Check(); | ||
Line 103: | Line 105: | ||
.UserName = "user" | .UserName = "user" | ||
.Password = "mypassword" | .Password = "mypassword" | ||
- | .SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | .SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..." |
End With | End With | ||
Line 110: | Line 112: | ||
session.Open(sessionOptions) | session.Open(sessionOptions) | ||
- | ' Execute mysqldump on the server to dump all MySQL databases and compress the results | + | ' Execute mysqldump on the server to dump all MySQL databases and |
+ | ' compress the results | ||
Const dbUsername As String = "USERNAME" | Const dbUsername As String = "USERNAME" | ||
Const dbPassword As String = "PASSWORD" | Const dbPassword As String = "PASSWORD" | ||
Line 116: | Line 119: | ||
Dim dumpCommand As String = _ | Dim dumpCommand As String = _ | ||
- | String.Format("mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", _ | + | String.Format( |
+ | ························"mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", _ | ||
dbUsername, dbPassword, tempFilePath) | dbUsername, dbPassword, tempFilePath) | ||
session.ExecuteCommand(dumpCommand).Check() | session.ExecuteCommand(dumpCommand).Check() |