Hello Monks! The Situation:
We got a Linux System with an old NT-Basic application that writes a Logfile (a simple text file) to a given path.
My task ;-) is now to a) "rotate" that logfile (its small so i could store a week or more till overwriting the first log) and
b) copy the logfile to a samba share on the same machine where it should be
c)copied (this could be a windows machine?) to a NAS share from which it could be accessed by some people (the bosses) My Problem: The Linux box is a SUSE 8.2 with Perl 5.8 and no cpan (I am not allowed to change that)
cause of compatibility issues with the systems and maybe the archive program which relies on the give Perl version.
The windows system i could change so maybe if it is best done with usage of modules i could do it here?
(SSH and ftp-access is possible so win-scp or simular tools could be used). Maybe you got a hint in which direction i should try to develop a solution?
Update: No Perl code i am afraid:
As i figured out the logfile is only produced during the daily backup job which is scheduled at night, so i solved it for the moment as i put a simple copy (shell #!/bin/sh) job in crontab which moves the file to the samba share. hint: crontab -e is different from /etc/crontab the sixth colon is not the username it starts with the command directly

/etc/crontab #min hour day month dow(day of week) user command 40 22 * * * root /usr/local/sbin/cplogb #users crontab (edit with crontab -e)the same thing without the userna +me in front of the command: 40 22 * * * /usr/local/sbin/cplogb
Update
hth maybe someone which didnt mess around with cron like me for some time ;-).
...

Thanks in Advance MH

In reply to How to do a manual "logrotate" on a given file? by matze77

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.