This script uses the Net::FTP and Net::Telnet modules and moves the mpg files over to be tagged with Oracle Video server information so it can be seen. The IP's are blanked out for obvious reasons = )
#!/usr/bin/perl use Net::FTP; use Net::Telnet; $MPG_DIR = "/testpl"; opendir(MDIR, $MPG_DIR) or die "Could not open dir $MPG_DIR for readin +g: $!\n"; @files = grep(/\.mpg$/, readdir(MDIR)); closedir(MDIR); $ftp = Net::FTP->new("IP ADDRESS HERE", Debug => 9) or die "ca +n't connect: $@\n"; ##### ####Maybe try pasv connection? # $ftp->pasv(); ##### $ftp->login("user", "password") or die "coul +dn't login\n"; $ftp->cwd("/mds/nvision1") or die "could +n't change directory\n"; #$ftp->quot("bin"); $ftp->binary(); #$ftp->quot("prompt"); $ftp->quot("allo 17595824"); foreach $x ( @files ) { # Does put populate $@ with error messages? If so, inspect them: $ftp->put($x) or die "could +n't put $x: $@\n"; } $ftp->quit; # outta here $t = Net::Telnet->new => (Timeout => 2000, Prompt => '/%/', Host => $hostname ); $t->login($user, $password); foreach $x ( @files ) { print $t "vstag -E mpi /mds/nvision1/$x\n"; } $t->close; # Redundant...to keep track of all of these, just put them near the # top. #use Net::FTP; $ftp = Net::FTP->new("IP ADDRESS HERE") or die "can +'t connect: $@\n"; $ftp->login("user", "password") or die "couldn +'t login\n"; $ftp->cwd("/mds/nvision1") or die "couldn +'t change directory\n"; print $ftp "bin\n"; print $ftp "prompt\n"; foreach $x ( @files ) {($a, $b) = split(/\.[^.]+$/, $x); # Check $@ if indeed Net::FTP populates it on get failure $ftp->get($x) or die "couldn't get $filename: $@\ +n"; } $ftp->quit; # outta here

2001-03-03 Edit by Corion : Fixed <BR> tags within <CODE> tags.


In reply to Mpg tagger by JSchmitz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.