Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey, so I've searched these forums, and google, but all I find is how to run a script every 5 seconds, or something like that. But that is not what I'm looking to do.
Say I want to launch a command at 2009-11-30 at 21:04:22 (yes, with seconds). How would I go about to launch this, as cron doesn't take seconds.
I've read about making scripts that loops every 1 second or so, but I'm not sure of how to do that.
What I would like to do is make a php-script that adds dates+times to launch specific command into cron?
Hope you understand what I mean. Any help appreciated.
The cron + sleep 22 seconds is prob going to be the easiest. Note that cron is used when you want a process to run repeatedly over time. at is for one shot processes.
FYI one can not be absolutely sure that a job will start at precisely 00 seconds. In addition jobs are executed in a top down fashion so the order of tasks in the crontab file will be important if you have multiple jobs that run at the same minute.
<?php if (isset($argv[1])) sleep($argv[1]); print "echo \"dummy has been run!\""; ?>
this command:
Code:
php /var/www/auto/dummy.php 10 < /dev/null | at -t 200911262256
when I hit enter after entering the above, it will take 10 seconds before i get back to prompt, which means it does the sleep(10) from the php-script directly? Or am I missing something? Is it supposed to act like this?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.