Sponsored Content
Full Discussion: How do I make a timed script
Top Forums Shell Programming and Scripting How do I make a timed script Post 302368335 by amcrisan on Wednesday 4th of November 2009 04:12:00 PM
Old 11-04-2009
How do I make a timed script

Hello,

I would like to make a script, ideally in perl since I am most familair with it, that does the following:

automatically starts up at 9 pm, searches through a specified directory for any new files, finds those new files and starts to run them through a pipeline. I have most of it worked out, but here are somethings I am not sure how to do:

1) How do I make it start automatically at 9pm? I could put it sleep and tell it to wait for 9pm, but the truth is that sometimes, when a lot of new data comes, it realistically can take 24 hours or more to run an initial instance of script. I feel it might get confused if I just band-aid it with a sleep command, however if that's the only solution then that's what I will have to do.

2) How do I get time stamps for the files in the directory?

Ideally I don't want to use to too many non-standard modules, because it can make it less portable since other users will also have to download all those modules to use my little scripts (assuming it works out, other people here would like to use it...).

Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Connection Timed out

I connect to a Sun Box through telnet but it timed out in couple of minutes. Advance thanks for any idea...help... (2 Replies)
Discussion started by: s_aamir
2 Replies

2. UNIX for Advanced & Expert Users

deferred: connection timed out with NT

We recently installed a new release of SCO UNIX (5.0.6) and when I try to relay e-mail from the UNIX box to my NT server (the mail server) I get the following message from sendmail. Deferred: Connection timed out with nt I have nt set up as my relay server in sendmail.cf and the mail seems to... (8 Replies)
Discussion started by: jmossman
8 Replies

3. UNIX for Dummies Questions & Answers

timed commands

Hello, How can I set up events to be executed at a certain time? And do I need some kind of privilege such as being in cron group? (2 Replies)
Discussion started by: rayne
2 Replies

4. HP-UX

connection timed out

I am trying to connect with my hp machine using "dialup networking." It times out after 30 seconds. Is there a way to adjust this time. Would it have anything to do with rexec? thanks (0 Replies)
Discussion started by: paschal
0 Replies

5. Programming

Timed wait?

Is there any way in which I can make my wait signal to wait for a specified time for child job to complete. And if that time is over, the program gets out of the wait signal to process other things (4 Replies)
Discussion started by: anjul_thegreat
4 Replies

6. Solaris

I/O timed out

I have Ultra 45 Sun solaris box with Solaris 10 installed. My problem is when i boot the unix box, i got the message: What does this message meant? then it does not continue to boot successfully. Please help. Thanks in advance. (5 Replies)
Discussion started by: etcpasswd
5 Replies

7. Solaris

RCP command timed out

I HAVE A PERL SCRIPT WHICH RCP files from one server to another. The script is not having any issues for years and it is running for more than 3 years . Last week it had failed with error "Command timed out " error. Please help me out (3 Replies)
Discussion started by: praviper
3 Replies

8. Shell Programming and Scripting

Timed Scripts

Hi all I need a little bit of help, i am looking for a script that can have different events in it and then if it is a certain day email me about it some sort of email reminder system any ideas thanks (4 Replies)
Discussion started by: ab52
4 Replies

9. Shell Programming and Scripting

timed kill within script?

I want to warn everyone, I am not a programmer lol. I'm an IT wanting to get a little insight of programming, and I like to play around so I can learn. Ok, so I'm going to school for IT Security and Forensics. I had a project to write a hack, and I chose to write a shell script to run dd to write... (8 Replies)
Discussion started by: joshbgosh10592
8 Replies

10. Shell Programming and Scripting

scp script getting timed out with expect

Hi, I have an expect script where in i am trying to scp a folder but it is getting timed out. Any help will be appreciated. (I don't have the option for sharing keys) expect -c 2> /dev/null " spawn scp -r -o NumberOfPasswordPrompts=1 -o StrictHostKeyChecking=no root@10.10.10.10:test_dir... (2 Replies)
Discussion started by: temp_user
2 Replies
Module::Install::FAQ(3pm)				User Contributed Perl Documentation				 Module::Install::FAQ(3pm)

NAME
Module::Install::FAQ - Frequently Asked Questions for Module::Install DESCRIPTION
Though Module::Install itself has a general FAQ section in the pod, it's more for advocacy. Here's an incomplete and growing list of the actual questions I have been frequently asked (or found on the net) about Module::Install. Do I also have to update my CPAN modules every time Module::Install is updated? The point of Module::Install is let module authors take care of everything related to updating toolchains for the sake of module users. So, if you choose to use Module::Install, it's you who should update toolchains, i.e. Module::Install and other bundled modules. You should check if there's any significant change/fix in your toolchains. You should check if your toolchains go along with other tools users use to install your distributions, or with the systems users are in, or whatever that matters. In the end, you are expected to have much more knowledge and willingness than average users. That being said, practically, you don't have to update your distributions if they are working well. But if you do find issues, please update your distributions, even when you have nothing to change in your own modules. Module::Install is not only a tool to write better, but also a tool to encourage you to help others. Do I really have to avoid auto_install()? Not at all, using "auto_install()" is just fine. While it indeed behaved erratically in older Module::Install versions, there have been no reported issues since mid-2009. As far as compatbility with various CPAN clients: several rather large projects on CPAN (including Catalyst and DBIx::Class), are using "auto_install" without any issues reported by their substantial userbases. That said, if all you want to do is make it easy for a contributor to checkout your code and quickly install necessary dependencies, there are alternatives to "auto_install". If your CPAN module is new enough, you can pass a dot to the cpan command it provides, and it will install all the required distributions from the CPAN: $ cpan . The same is true for the cpanm command from App::cpanminus, with which you even can write like "cpanm --installdeps ." Should I put an "inc" directory Module::Install automatically creates into a repository for my projects? Depends. If the repository is private and only for you, you usually don't want to put it in your repository to let you always use the latest Module::Install you have (the "inc" directory is recreated each time you run "perl Makefile.PL"). If not, but you alone are the release manager and know what you have to do when you release, putting the "inc" directory into your repository may help other casual contributors, especially if you use minor (or private) non-core extensions in your Makefile.PL. However, if you generously allow other people to release, or you're not so familiar with how Module::Install works and don't know what you have to do in the above situation, don't put it in the repository. It may be the cause of troubles including a wrong version in the "META.yml". If you feel sorry about the inconvenience for your fellow contributors, you may want to add explicitly "use Module::Install::<ExtensionYouWantToUse>;" after "use inc::Module::Install;" in your Makefile.PL. It doesn't do any harm, and it makes clear which extensions they need to install. What're there in the "inc" directory? Module::Install puts its components (sometimes with extra modules) under the "inc" directory to be released with a distribution. Those modules will not be installed into your system, unless explicitly copied into somewhere. They are only used to help configuration, tests, and/or installation. If there's no "inc" directory, Module::Install will automatically create it when you run "perl Makefile.PL". And if that happens, a directory (as of this writing, ".author") will also be created under the "inc" directory. If the ".author" directory exists, the "inc" directory will be recreated each time you run "perl Makefile.PL" to make sure everything you need is included and up-to-date. This ".author" directory will not be included in a distribution. "perl Makefile.PL" doesn't work or does a strange behavior for me. Why? Module::Install uses an Autoloader magic to delegate command handling to the extensions in the "inc" directory. This works while everything is in order, but when it finds something it can't understands, it dies with a compile error, or does what you don't expect. To prevent the latter strange behavior, Module::Install 0.96 and above dies when it tries to process unknown commands. In most cases (other than typos), these unknown commands are from non-core extensions on the CPAN, and they should hopefully have predictable names that you can easily tell from which extension they come, though some may be a bit hard to find. If you are trying to contribute to some project, and having a trouble to run "Makefile.PL", please contact the author of the project to learn what you have to install. If the distribution is already on the CPAN, you may also want to look into the MANIFEST file to see which extensions are included in the "inc" directory before you ask. This usually does not happen in the user land as distributions that use Module::Install should have all the necessary extensions under the "inc" directory. If this should happen, that's most probably because the release manager shipped the distribution under a non-author mode. Please contact the author to fix the issue. Why can't I do <anything> with Module::Install that I can do with ExtUtils::MakeMaker? Module::Install is just a wrapper of ExtUtils::MakeMaker. You can do almost everything you can do with ExtUtils::MakeMaker by passing arbitrary attributes to ExtUtils::MakeMaker in the backend via "makemaker_args" like this: use inc::Module::Install; all_from 'lib/Foo/Bar.pm'; makemaker_args( dist => { PREOP => '...' }, PL_FILES => {'bin/foobar.PL' => 'bin/foobar'}, ); WriteAll; However, by the singleton nature of Module::Install, it may fail to process Makefile.PLs in subdirectories correctly now, and you may need to override attributes explicitly in some cases where Module::Install provides other default values than ExtUtils::MakeMaker does. Please see also the ExtUtils::MakeMaker's pod for further instructions. I added MyMakefile.PL to my distribution, but it doesn't work as I expected. Why? ExtUtils::MakeMaker (and Module::Build also) treats "*.PL" files in the top level directory as something special to generate other files. So, if you add something that has ".PL" extension like "MyMakefile.PL" in the top level directory, it also runs automatically when you run Makefile.PL. If you don't like this behavior, use "makemaker_args" to pass an anonymous hash to "PL_FILES". makemaker_args(PL_FILES => {}); AUTHOR
Kenichi Ishigaki <ishigaki@cpan.org> COPYRIGHT
Copyright 2010 Kenichi Ishigaki. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-01 Module::Install::FAQ(3pm)
All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy