Running a perl script as a cron job

74 views
Skip to first unread message

Julian Cook/Sherab Gyatso

unread,
Oct 15, 2000, 3:00:00 AM10/15/00
to
Hi folks!
I am running Redhat 6.1 and Perl 5.6
The machine in my office does a LOT of processing and it needs to
FTP the files it creates to two other virtual machines.
I have managed to get the whole procedure down using the Net::FTP
module.
<CREDIT>
In short,..IMHO it's a great little set up I have here. The
credit for creating this is largely due to the help I have received
from this group. Thank you very much.
</CREDIT>
What I would like to do is to set this PERL script as a cron job to
do it's processing and FTPing every 15 minutes.
Does anyone have any idea how I can accomplish this? I am not a
Linux whiz (at least not yet) and this seems to be my one big hang up.
I suppose I could create this script to constantly run but that seems
like a big drain on resources.

Any advice is greatly appreciated.

Many thanks again for all of your help.
Julian Cook
president_at_webticker_dot_com

Tony Lawrence

unread,
Oct 16, 2000, 3:00:00 AM10/16/00
to
Julian Cook/Sherab Gyatso wrote:

> What I would like to do is to set this PERL script as a cron job to
> do it's processing and FTPing every 15 minutes.

OK. So your cron entry says:

0,15,30,45 * * * * /usr/local/bin/yourftp >/dev/null 2>&1

See also http://pcunix.com/Unixart/cron.html and of course the
man pages on your own system.

> Does anyone have any idea how I can accomplish this? I am not a
> Linux whiz (at least not yet) and this seems to be my one big hang up.
> I suppose I could create this script to constantly run but that seems
> like a big drain on resources.

Not necessarily. If it does a "sleep 900" it isn't using any cpu
time, and whatever memory it uses can be paged out if it is
needed. But cronning it is fine.

--
Tony Lawrence (to...@aplawrence.com)
SCO/Linux articles, help, book reviews, tests,
job listings and more : http://www.pcunix.com

Reply all
Reply to author
Forward
0 new messages