Hello monks,
I am having a problem running a perl script via cron.. Linux ES4 v2.
I run the script at command line and it runs fine. I run it through cron and it does not seem to wait until the tarball is fully created before it FTP's the incomplete tarball. is there a way to make the script complete the "tar" before begining the "ftp"?
#!/usr/bin/perl
use IO::Dir;
tie %dir, 'IO::Dir', "club";
foreach (keys %dir) {
next if $_ eq ".";
next if $_ eq "..";
push( @files, "club/" . $_ );
}
use Archive::Tar;
my $tar = Archive::Tar->new;
$tar->add_files( @files );
$tar->write('club_db.tar');
use Net::FTP;
$ftpobj = Net::FTP -> new ("192.168.1.21");
$ftpobj -> login("username","passwd");
$ftpobj -> binary;
$ftpobj -> put ("club_db.tar");
$ftpobj -> quit;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|