http://qs321.pair.com?node_id=762222

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

Hi, I have to execute DB connection after one hour of cp command is executed. How can I execute it without cron tab
`cp $file1 $file2`; ###### ###DB connection # Statements #####

Replies are listed 'Best First'.
Re: Execute db connection
by Anonymous Monk on May 06, 2009 at 11:11 UTC
    sleep for an hour( 60 * 60)
Re: Execute db connection
by cdarke (Prior) on May 06, 2009 at 13:51 UTC
    Or use the 'at' command, which is run by crond but does not require crontab - it runs jobs as a one-off. Or use Proc::Background.
      For this file
      #!/usr/bin/perl $date = `date`; print $date;
      I had set the at command like this at -m 02:21 < date.pl But nothing got printed on the screen. How will I know that the job has been executed
        crond doesn't provide screens/terminals to watch