Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

possibility to start a skript as a cron-job without accessing the crontable

by pitbull3000 (Beadle)
on Aug 26, 2001 at 03:17 UTC ( #107868=perlquestion: print w/replies, xml ) Need Help??

pitbull3000 has asked for the wisdom of the Perl Monks concerning the following question:

hi hi, is there some posibility to get a perl skript running as a cron-job, without having access to the crontable?
  • Comment on possibility to start a skript as a cron-job without accessing the crontable

Replies are listed 'Best First'.
Re: possibility to start a skript as a cron-job without accessing the crontable
by jlongino (Parson) on Aug 26, 2001 at 04:10 UTC
    There is one way, although there are some dependencies attached to the at or batch commands:
     
    • This information was found in the Solaris (Unix) man pages. There may be Linux equivalents.
    • There are conditions attached to the existence and contents two files, /usr/lib/cron/at.allow and /usr/lib/cron/at.deny.
      Users are permitted to use at and batch (see below) if their name appears in the file /usr/lib/cron/at.allow. If that file does not exist, the file /usr/lib/cron/at.deny is checked to determine if the user should be denied access to at. If neither file exists, only a user with the solaris.jobs.user authorization is allowed to submit a job. If only at.deny exists and is empty, global usage is permit- ted. The at.allow and at.deny files consist of one user name per line.

      One example they give is:
     
      Example 3: Self-rescheduling a job
        To have a job reschedule itself, at can be invoked from within the at-job. For example, this "daily-processing" script named my.daily will run every day (although crontab is a more appropriate vehicle for such work):

        # my.daily runs every day
        at now tomorrow < my.daily
        daily-processing

    Of course, you could talk to the sys admin and request the priviledge of using crontab, at or batch.

    If the code and the comments disagree, then both are probably wrong. -- Norm Schryer

Re: possibility to start a skript as a cron-job without accessing the crontable
by idnopheq (Chaplain) on Aug 26, 2001 at 16:21 UTC
    Net::Daemon or Chapter 17, recipe 17.15 in The Perl Cookbook. If you're on a Win32 box, I think there's a Win32::Daemon as well.

    You would have the program sit there and wait for a certain time or time interval, then do it's thing. A quick Super Search on 'daemon' or 'cron' will give you lots of other options.

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

Re: possibility to start a skript as a cron-job without accessing the crontable
by BrotherAde (Pilgrim) on Aug 26, 2001 at 16:25 UTC

    Some time ago, I pointed out an emulation of cron running in Perl. If you can run perl-programs under your account (which I assume you can), you might give this a go. You can find it under www.megadodo.demon.co.uk/perl/. The comments in the code say it's for NT, but I assume it shouldn't be difficult - if anything has to be changed at all - to get it to run on linux.

    Hope that helps,
    BrotherAde

      but as far as i understand this thing from megadodo it will run as a service under nt... how could i emulate such on a linux box?

        The way I saw it, it can run as a service on an NT-box. I assume (haven't tested) that you can run it as a background process on linux by appending a & to the command.

        Keep me posted!
        BrotherAde

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://107868]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2022-12-01 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?