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 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"'); }