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

Hello all, Please, I want to schedule a task to run update_blastdb.pl every week. I can run it manually from cmd by typing: Perl update_blastdb.pl --passive --decompress refseq_rna It ran successfully. How can I schedule the task to run it automatically? and how can I pass the arguments: --passive --decompress refseq_rna? and how can I check if it connecting to NCBI successfully? which volume is being installed? As cmd do. I am using windows task scheduler. Thank you.
  • Comment on OT: schedule a task to run update_blastdb.pl script

Replies are listed 'Best First'.
Re: OT: schedule a task to run update_blastdb.pl script
by Marshall (Canon) on Mar 28, 2016 at 23:58 UTC
    Under Windows, you can make the commands that work from the command line into a .bat file. Test that from the command line with XXX.bat. A .bat file is an executable with windows commands. Then schedule the XXX.bat file to run as you need it. It is not possible with the scheduler to pass arguments to a program, that is why you need a .bat or Batch file to do that.

    You may find this helpful: Windows Batch Scripting.

    Of course it is possible to have a Perl program run in the .bat (or Batch) file.

    Although this is an OS specific question, automating Perl programs is a common task and Windows is a common OS.

Re: OT: schedule a task to run update_blastdb.pl script
by soonix (Chancellor) on Mar 29, 2016 at 07:39 UTC
        yes, but newer MS doc says
        Schtasks replaces At.exe, a tool included in previous versions of Windows. Although At.exe is still included in the Windows Server 2003 family, schtasks is the recommended command-line task scheduling tool.