N
Nathan Pryor
I need to capture all standard output of an ftp session that is run
inside a perl program. Short example:
#!/usr/bin/perl
system("ftp -i ftp.gnu.org > results");
I use a .netrc file to list the commands for the ftp session:
machine ftp.gnu.org
login anonymous
password (e-mail address removed)
macdef init
lcd /tmp
ls
pwd
bye
I have no problems capturing all standard output, both local and
remote, when I run the script from the command line. However, when I
run the script using a cron job only the standard output from the
remote host shows up in the file. In my real script I am using "mput"
to send several files to the remote host so I need to see the local
standad output in order to verify all files transferred successfully.
Any suggestions?
Perl version: This is perl, v5.6.1 built for i386-linux
inside a perl program. Short example:
#!/usr/bin/perl
system("ftp -i ftp.gnu.org > results");
I use a .netrc file to list the commands for the ftp session:
machine ftp.gnu.org
login anonymous
password (e-mail address removed)
macdef init
lcd /tmp
ls
pwd
bye
I have no problems capturing all standard output, both local and
remote, when I run the script from the command line. However, when I
run the script using a cron job only the standard output from the
remote host shows up in the file. In my real script I am using "mput"
to send several files to the remote host so I need to see the local
standad output in order to verify all files transferred successfully.
Any suggestions?
Perl version: This is perl, v5.6.1 built for i386-linux