Scp automatique de windows vers Unix

Résolu/Fermé
p_oum Messages postés 963 Date d'inscription mardi 6 mai 2008 Statut Membre Dernière intervention 2 avril 2012 - 10 févr. 2012 à 18:16
p_oum Messages postés 963 Date d'inscription mardi 6 mai 2008 Statut Membre Dernière intervention 2 avril 2012 - 10 févr. 2012 à 19:04
Bonjour,

Je cherche un moyen de réaliser une copie de fichier depuis un windows server 2008 vers un serveur debian de maniere automatique, typiquement la commande windows équivalante a la commande Unix:

scp maSource root@IP:/maDestination que je mettrai dans un crontab

J'imagine qu'il est possible de faire la meme chose via une tache planifier windows ?

Merci
A voir également:

3 réponses

zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 407
Modifié par Jeff le 15/05/2013 à 10:16
Salut,

PSCP (an SCP client, i.e. command-line secure file copy)

;-))
Zen my nuggets ;-)
Faites un geste pour l'environnement, fermez vos fenêtres et adoptez un manchot.
0
p_oum Messages postés 963 Date d'inscription mardi 6 mai 2008 Statut Membre Dernière intervention 2 avril 2012 87
10 févr. 2012 à 18:45
Bonjour,

Merci c'est exactement ce qu'il me faut. Cependant j'aurais encore une petite question:

Lorsque je fait dans un invite de commande :
pscp.exe -scp -pw toto C:\backup_sql\* wam@2.2.2.2:/home/wam/backup/ cela fonctionne tres bien

Je voudrais maintenant utiliser cette commande dans un .bat afin de l'ajouter a une tache planifié
J'ai donc créer un fichier backup.bat ou j'ai ajouter la ligne suivante:
C:\Utilitaire\pscp.exe -scp -pw toto C:\backup_sql\* wam@2.2.2.2:/home/wam/backup/

Seulement lorsque j'exécute backup.bat j'ai le message d'erreur:
C:\Utilitaire\pscp is not a valid Win32 application

Une petite idee ?

Merci
0
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 407
10 févr. 2012 à 18:53
Honnêtement je n'en sais rien ;-(

Est-ce qu'en ligne de commande avec le chemin complet (C:\Utilitaire\pscp.exe) ça passe ou tu as aussi l'erreur ?
0
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 407
10 févr. 2012 à 18:59
Extrait :
5.1 Starting PSCP

PSCP is a command line application. This means that you cannot just double-click on its icon to run it and instead you have to bring up a console window. With Windows 95, 98, and ME, this is called an `MS-DOS Prompt' and with Windows NT, 2000, and XP, it is called a `Command Prompt'. It should be available from the Programs section of your Start Menu.

To start PSCP it will need either to be on your PATH or in your current directory. To add the directory containing PSCP to your PATH environment variable, type into the console window:

set PATH=C:\path\to\putty\directory;%PATH%

This will only work for the lifetime of that particular console window. To set your PATH more permanently on Windows NT, 2000, and XP, use the Environment tab of the System Control Panel. On Windows 95, 98, and ME, you will need to edit your AUTOEXEC.BAT to include a set command like the one above. 
0
p_oum Messages postés 963 Date d'inscription mardi 6 mai 2008 Statut Membre Dernière intervention 2 avril 2012 87
10 févr. 2012 à 19:04
En faite j'avais juste dl exécutable pscp.exe, en installant tout le package putty ca fonctionne

Merci
0