Je souhaite faire un script pour gerer les backups de mes sites, mais j'ai un bug assez bizarre. J'ai fait un petit script pour expliquer où se situe mon probleme :
Quand j'execute ce script en local sur glftpd, aucun soucis, mais quand je l'essaye sur drftpd, qui est le serveur dont il faudra que je me serve au final, j'obtiens ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #!/usr/bin/perl use Net::FTPSSL; use warnings; use strict; my $ftp_host="localhost"; my $ftp_port=21; my $ftp_user="user"; my $ftp_pwd="password"; my $folder="site/backup"; my $ftps = Net::FTPSSL->new($ftp_host, Port => $ftp_port, Encryption => 'E', Debug => 1) or die "Erreur connection\n"; $ftps->login($ftp_user, $ftp_pwd); my @listing=$ftps->nlst("/".$folder); open(rep, ">listing"); foreach(@listing){ print rep "$_\n"; } close(rep); $ftps->quit();
[niet@localhost backups]$ ./backups.pl
Unquoted string "rep" may clash with future reserved word at ./backups.pl line 18.
Unquoted string "rep" may clash with future reserved word at ./backups.pl line 19.
Unquoted string "rep" may clash with future reserved word at ./backups.pl line 20.
SKT <<< 220 DrFTPD+ 2.0-SVN $Revision$ http://drftpd.org
SKT >>> AUTH TLS
SKT <<< 234 AUTH TLS successful
Can't call method "login" on an undefined value at ./backups.pl line 14.
Erreur connection
Le script se connecte, envoit AUTH TLS...mais meurt à la connection ? Je voit pas où ça bloque. Si quelqu'un peut m'éclairer ?![]()
Partager