JLT>Root Aucun résumé des modifications |
Aucun résumé des modifications |
||
| (8 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
{{#seo:|keywords=Winscp,script}} | |||
{{ToolsVersion|Name=Winscp|Version=5.7.6|OS=Windows|image=http://images.jltryoen.fr/mediawiki/WinSCP.png}} | {{ToolsVersion|Name=Winscp|Version=5.7.6|OS=Windows|image=http://images.jltryoen.fr/mediawiki/WinSCP.png}} | ||
{{grebox-jck | {{grebox-jck | ||
|content= | |content= | ||
[[Description::J'utilise '''WINSCP version 5.7.6''']] {{ | [[Description::J'utilise '''WINSCP version 5.7.6''']] {{Download|keyword=winscp_download}} | ||
On peut l'utiliser en mode '''"manuel"''' et aussi en mode '''"automatique"''' | On peut l'utiliser en mode '''"manuel"''' et aussi en mode '''"automatique"'''<br><br> | ||
}} | }} | ||
{{blubox-jck | {{blubox-jck | ||
|content= | |title= | ||
* Un exemple d'appel en ligne | |content=<br> | ||
* Un exemple d'appel en ligne{{indent | {{syntaxhighlight | lang=winbatch|code= | |||
"C:\Program Files\WinSCP\winscp.exe" /console /command "option batch on" | "C:\Program Files\WinSCP\winscp.exe" /console /command "option batch on" | ||
"open tryoen:xxxxx@192.168.1.12" "put c:\temp /home/tryoen/" "exit" | "open tryoen:xxxxx@192.168.1.12" "put c:\temp /home/tryoen/" "exit" | ||
}} | }} | ||
}}<br> | |||
* Un autre exemple avec l'utilisation d'un script pour envoyer un fichier | * Un autre exemple avec l'utilisation d'un script pour envoyer un fichier | ||
: {{syntaxhighlight | lang=winbatch|code= | *: {{syntaxhighlight | lang=winbatch|code= | ||
"C:\Program Files\WinSCP\winscp.exe" /console /script=G:\user\linux\winscp.scp | "C:\Program Files\WinSCP\winscp.exe" /console /script=G:\user\linux\winscp.scp | ||
/parameter c:\temp 192.168.1.12 | /parameter c:\temp 192.168.1.12 | ||
}} | }} | ||
* contenu de {{file |winscp.scp}} | |||
: {{syntaxhighlight | lang=winbatch|code= | * contenu de {{file |winscp.scp}} | ||
*: {{syntaxhighlight | lang=winbatch|code= | |||
option confirm off | option confirm off | ||
open tryoen:xxxx@%2% | open tryoen:xxxx@%2% | ||
| Ligne 31 : | Ligne 37 : | ||
{{blubox-jck | {{blubox-jck | ||
|title= | |title= | ||
|content= | |content=<br> | ||
== Un script pour sauvegarder un répertoire sur un serveur linux == | == Un script pour sauvegarder un répertoire sur un serveur linux == | ||
:{{syntaxhighlight |lang=winbatch|code= | :: {{syntaxhighlight |lang=winbatch|code= | ||
"C:\Program Files (x86)\WinSCP\winscp.exe" /console /script=synchronize.scp /parameter "c:\Documents" /lcs_linux/users/jlt/Documents | "C:\Program Files (x86)\WinSCP\winscp.exe" /console /script=synchronize.scp /parameter "c:\Documents" /lcs_linux/users/jlt/Documents | ||
}} | }} | ||
{{clear}} | {{clear}} | ||
: contenu de {{file |synchronize.scp}} | :: contenu de {{file |synchronize.scp}} | ||
:{{syntaxhighlight |lang=winbatch|code= | :: {{syntaxhighlight |lang=winbatch|code= | ||
{{#!: | {{#!: | ||
open jlt@192.168.10.1 | open jlt@192.168.10.1 | ||
Winscp
| |
|---|---|
| Version | 5.7.6 |
| OS | Windows |
Article publié le : 16 décembre 2018 19:50:41
Download WinSCP
On peut l'utiliser en mode "manuel" et aussi en mode "automatique"
"C:\Program Files\WinSCP\winscp.exe" /console /command "option batch on"
"open tryoen:xxxxx@192.168.1.12" "put c:\temp /home/tryoen/" "exit"
"C:\Program Files\WinSCP\winscp.exe" /console /script=G:\user\linux\winscp.scp
/parameter c:\temp 192.168.1.12
option confirm off
open tryoen:xxxx@%2%
put %1% /home/tryoen/*
#exit permet de sortir de la console
exit
"C:\Program Files (x86)\WinSCP\winscp.exe" /console /script=synchronize.scp /parameter "c:\Documents" /lcs_linux/users/jlt/Documents
open jlt@192.168.10.1
# Synchronize paths provided via environment variables
call mkdir %2%
synchronize remote -delete %1% %2%
call find %2% -name .svn .| xargs rm -rf
call tar -C %2% -zcf %2%.`date +%Y-%m-%d`.tar.gz .
# remove old tarball
call echo "find . -name '`basename %2%`*.tar.gz' -ctime +30 -exec echo '{}' \;"
call find `dirname %2%` -name "`basename %2%`*.tar.gz" -ctime +30 -exec rm -f '{}' \;
# exit console
exit