Differences
This shows you the differences between the selected revisions of the page.
2006-04-01 | 2006-04-01 | ||
no summary (212.96.164.161) (hidden) | no summary (212.96.164.161) (hidden) | ||
Line 22: | Line 22: | ||
Note that the configuration also includes [[ssh#verifying_the_host_key|verified host keys]], which you may need to transfer as well (or confirm manually under the account) to allow automatic execution of the script. | Note that the configuration also includes [[ssh#verifying_the_host_key|verified host keys]], which you may need to transfer as well (or confirm manually under the account) to allow automatic execution of the script. | ||
- | ===== Example ===== | + | ===== Příklad ===== |
- | The example below connects to ''example.com'' server with account ''user'', downloads file and closes the session. Then it connects to the same server with the account ''user2'' and uploads the file back. | + | Příklad uvedený níže se připojuje k serveru ''example.com'' s uživatelským účtem ''user'', stahne soubor a ukonší spojeni. Pak se připojí ke stejnému serveru jako uživatel ''user2'' a nahraje soubor zpět. |
<code winscp> | <code winscp> | ||
- | # Automatically answer all prompts negatively not to stall | + | # automaticky odpovídej na vše negativně bez zastavení na chybách skriptu |
- | # the script on errors | + | |
option batch on | option batch on | ||
- | # Disable overwrite confirmations that conflict with the previous | + | # potlač přepis potvrzení, které jsou v rozporu s dřívějšími |
option confirm off | option confirm off | ||
- | # Connect using a password | + | # Připojení s použitím hesla |
# open user:password@example.com | # open user:password@example.com | ||
- | # Connect | + | # připojení |
open user@example.com | open user@example.com | ||
- | # Change remote directory | + | # Změň vzdálenou složku |
cd /home/user | cd /home/user | ||
- | # Force binary mode transfer | + | # Vynuť si binární přenos |
option transfer binary | option transfer binary | ||
- | # Download file to the local directory d:\ | + | # Stahni soubor do lokální složky na d:\ |
get examplefile.txt d:\ | get examplefile.txt d:\ | ||
- | # Disconnect | + | # Odpojení |
close | close | ||
- | # Connect as a different user | + | # Připoj se jako jiný uživatel |
open user2@example.com | open user2@example.com | ||
- | # Change the remote directory | + | # Změn vzdálený adresář |
cd /home/user2 | cd /home/user2 | ||
- | # Upload the file to current working directory | + | # nahraj soubor do pracovního adresáře |
put d:\examplefile.txt | put d:\examplefile.txt | ||
- | # Disconnect | + | # odpoj se |
close | close | ||
- | # Exit WinSCP | + | # konec WinSCP |
exit | exit | ||
</code> | </code> | ||
- | Save the script to the file ''example.txt''. To execute the script file use following command. As the script connects the session itself, using the command ''open'', omit the ''session'' command-line parameter. | + | Ulož skript do souboru ''example.txt''. K provedení skriptu použij následující příkaz. To execute the script file use following command. As the script connects the session itself, using the command ''open'', omit the ''session'' command-line parameter. |
<code> | <code> | ||
winscp3 /console /script=example.txt | winscp3 /console /script=example.txt | ||
</code> | </code> | ||
- | Instead of using ''open'' command you can also open a session using a [[commandline|command-line parameter]]. | + | Místo použití příkazu ''open'' command you can also open a session using a [[commandline|command-line parameter]]. |
<code> | <code> | ||
winscp3 /console /script=example.txt user@example.com | winscp3 /console /script=example.txt user@example.com | ||
</code> | </code> |