From: Radoulov, Dimitre on
On 17/06/2010 17.46, Atropo wrote:
> On Jun 17, 2:40 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com> wrote:
>> On 16/06/2010 18.33, Atropo wrote:

[...]

> before asking you i was trying this, according to tutorials. why it
> did not work?
>
> perl -MNet::FTP -le'
> ( $host, $user, $pass, $dir ) = @ARGV;
> $my_file = "recibidos.txt";
> OPEN(PLOT,">>$my_file") or die("The file cannot be opened!");
> $ftp = Net::FTP->new($host) or die "$@\n";
> $ftp->login( $user, $pass ) or die $ftp->message;
> $ftp->cwd($dir) or die $ftp->message;
> $ftp->binary;
> /(.*)\.tag$/ and $files_ko{$1} = 1
> or push @files, $_
> for $ftp->ls;
> for (@files) {
> $ftp->get($_) and $ftp->delete($_)
> unless exists $files_ko{$_};
> print PLOT "$_\n";
> }
> $ftp->quit or die $ftp->message;
> CLOSE(PLOT)
> '<host> <user> <pass> <dir>



open and close should be in lowercase.



Regards
Dimitre
From: Atropo on
On 17 jun, 02:40, "Radoulov, Dimitre" <cichomit...(a)gmail.com> wrote:
> On 16/06/2010 18.33, Atropo wrote:
>
>
>
> > On Jun 16, 8:52 am, Atropo<lxvasq...(a)gmail.com>  wrote:
> >> On Jun 16, 5:07 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com>  wrote:
>
> >>> On 15/06/2010 20.31, Atropo wrote:
>
> >>>> On Jun 15, 2:08 pm, Atropo<lxvasq...(a)gmail.com>    wrote:
> >>>>> On Jun 15, 11:03 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com>
> >>>>> wrote:
>
> >>>>>> On 15/06/2010 16.52, Atropo wrote:
>
> >>>>>>> On Jun 15, 10:27 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com>
> >>>>>>> wrote:
> >>>>>>>> On 15/06/2010 15.52, Atropo wrote:
>
> >>>>>>>>> On Jun 14, 4:51 pm, "Radoulov, Dimitre"<cichomit...(a)gmail.com>        wrote:
> >>>>>>>>>> On 14/06/2010 22.47, Radoulov, Dimitre wrote:
>
> >>>>>>>>>>> On 14/06/2010 15.47, Atropo wrote:
> >>>>>>>>>>>> Hi all, I'm on solaris 5.10 and trying to get several files from
> >>>>>>>>>>>> windows server, but with the condition that the files do not have the
> >>>>>>>>>>>> extension ".par"
>
> [...]
>
> > One very last thing. how can i create a log file with the names of the
> > files i had fetched.   and append to this file everytime this script
> > runs.
>
> perl >> ftp.log -MNet::FTP -le'
>      ( $host, $user, $pass, $dir ) = @ARGV;
>      $ftp = Net::FTP->new($host) or die "$@\n";
>      $ftp->login( $user, $pass ) or die $ftp->message;
>      $ftp->cwd($dir) or die $ftp->message;
>      $ftp->binary;
>      /(.*)\.tag$/ and $files_ko{$1} = 1
>        or push @files, $_
>        for $ftp->ls;
>      for (@files) {
>          $ftp->get($_) and $ftp->delete($_) and
>                   print unless exists $files_ko{$_};
>      }
>      $ftp->quit or die $ftp->message;
>    ' <host> <user> <pass> <dir>
>
> Regards
> Dimitre

Sorry Dimitre, everytime i touch this script it stop working, and i
don't know why. i tried to print in the log file, the date the file
was transfered. i added a few lines. the ones that refers to date.

perl >> ftp.log -MNet::FTP -le'
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
( $host, $user, $pass, $dir ) = @ARGV;
$ftp = Net::FTP->new($host) or die "$@\n";
$ftp->login( $user, $pass ) or die $ftp->message;
$ftp->cwd($dir) or die $ftp->message;
$ftp->binary;
/(.*)\.tag$/ and $files_ko{$1} = 1
or push @files, $_
for $ftp->ls;
for (@files) {
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset,
$dayOfWeek, $dayOfYear, $daylightSavings) = gmtime();
$year = 1900 + $yearOffset;
$theGMTime = "$hour:$minute:$second, $weekDays[$dayOfWeek]
$months[$month] $dayOfMonth, $year";
$ftp->get($_) and $ftp->delete($_) and
print unless exists $files_ko{$_}, $theGMTime;
}
$ftp->quit or die $ftp->message;
' <host> <user> <pass> <dir>
From: pk on
Atropo wrote:

> Sorry Dimitre, everytime i touch this script it stop working, and i
> don't know why. i tried to print in the log file, the date the file
> was transfered. i added a few lines. the ones that refers to date.

I'm not going to touch on the actual issue here, but why don't you just list
*ALL* your requirements from the start, so you can have a fully working
script, rather than only telling part of the story and thinking you can
figure out the rest for yourself?

It would save your time, and that of whoever wants to help you.

Also, though not strictly related, this page could probably be useful:

http://mywiki.wooledge.org/XyProblem
From: Atropo on
On 29 jun, 13:05, pk <p...(a)pk.invalid> wrote:
> Atropo wrote:
> > Sorry Dimitre,   everytime i touch this script it stop working, and i
> > don't know why.  i tried to print in the log file, the date the file
> > was transfered.   i added a few lines.   the ones that refers to date.
>
> I'm not going to touch on the actual issue here, but why don't you just list
> *ALL* your requirements from the start, so you can have a fully working
> script, rather than only telling part of the story and thinking you can
> figure out the rest for yourself?
>
> It would save your time, and that of whoever wants to help you.
>
> Also, though not strictly related, this page could probably be useful:
>
> http://mywiki.wooledge.org/XyProblem

You're right PK, i though that RTFM would help me to learn enough to
complete the work. beside this, i have users that keep asking for
more. sorry i can't read your suggestion at http://mywiki.wooledge.org/XyProblem
it's filter as a social networking and avoided on my work place.

From: Radoulov, Dimitre on
On 28/06/2010 22.30, Atropo wrote:
> On 17 jun, 02:40, "Radoulov, Dimitre"<cichomit...(a)gmail.com> wrote:
>> On 16/06/2010 18.33, Atropo wrote:
>>
>>
>>
>>> On Jun 16, 8:52 am, Atropo<lxvasq...(a)gmail.com> wrote:
>>>> On Jun 16, 5:07 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com> wrote:
>>
>>>>> On 15/06/2010 20.31, Atropo wrote:
>>
>>>>>> On Jun 15, 2:08 pm, Atropo<lxvasq...(a)gmail.com> wrote:
>>>>>>> On Jun 15, 11:03 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com>
>>>>>>> wrote:
>>
>>>>>>>> On 15/06/2010 16.52, Atropo wrote:
>>
>>>>>>>>> On Jun 15, 10:27 am, "Radoulov, Dimitre"<cichomit...(a)gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>> On 15/06/2010 15.52, Atropo wrote:
>>
>>>>>>>>>>> On Jun 14, 4:51 pm, "Radoulov, Dimitre"<cichomit...(a)gmail.com> wrote:
>>>>>>>>>>>> On 14/06/2010 22.47, Radoulov, Dimitre wrote:
>>
>>>>>>>>>>>>> On 14/06/2010 15.47, Atropo wrote:
>>>>>>>>>>>>>> Hi all, I'm on solaris 5.10 and trying to get several files from
>>>>>>>>>>>>>> windows server, but with the condition that the files do not have the
>>>>>>>>>>>>>> extension ".par"
>>
>> [...]

> Sorry Dimitre, everytime i touch this script it stop working, and i
> don't know why. i tried to print in the log file, the date the file
> was transfered. i added a few lines. the ones that refers to date.
[...]


perl >> ftp.log -MNet::FTP -le'
( $host, $user, $pass, $dir ) = @ARGV;
$ftp = Net::FTP->new($host) or die "$@\n";
$ftp->login( $user, $pass ) or die $ftp->message;
$ftp->cwd($dir) or die $ftp->message;
$ftp->binary;
/(.*)\.tag$/ and $files_ko{$1} = 1
or push @files, $_
for $ftp->ls;
for (@files) {
$ftp->get($_) and $ftp->delete($_) and
print scalar gmtime, ": ", $_ unless exists $files_ko{$_};
}
$ftp->quit or die $ftp->message;
' <host> <user> <pass> <dir>




Regards
Dimitre
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Launch and exit the browser
Next: Huge mailbox split?