Thread SCP im Systembefehl (9 answers)
Opened by Aendrew at 2008-10-29 12:04

Gast Gast
 2008-10-29 19:33
#115831 #115831
"\p" oder "\m" versteht perl nicht für ihn ist das einfch "p" oder "m"
Wenn du Doublequotes benutzen willst musst du "\" entwerten so: "\\" oder du nimmst Singlequotes:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
my $befehl = 'C:\putty\pscp.exe -i "C:\mykey.ppk" -v -batch "testuser\@192.168.3.24:/home/otheruser/information.txt" "D:\import" 1>> D:\\import\\log.txt 2>>&1';
if(system($befehl))
{
  print "Datei <information.txt> konnte nicht übertragen werden! -\n";
  system('C:\putty\plink.exe -ssh -batch -i "C:\mykey.ppk" testuser\@192.168.3.24 "mv /home/otheruser/information.txt /home/otheruser/ERR_information.txt"');
}
else
{
  system('C:\putty\plink.exe -ssh -batch -i "C:\mykey.ppk" testuser\@192.168.3.24 "rm /home/otheruser/information.txt"');
}

View full thread SCP im Systembefehl