Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Situation: I have 2 identical scripts each doing their thing in their own directory:
/data/dir1/script.sh
/data/dir2/script.sh
Each script works as it should when I execute it manually.
Ik put the following commands in bleh.cron:
15,30,45,0 * * * * /data/dir1/script.sh
15,30,45,0 * * * * /data/dir2/script.sh
After that, I did "crontab bleh.cron", crontab -l gives back both lines of bleh.cron (15,30,45,0 * * * * /data/dir1/script.sh & 15,30,45,0 * * * * /data/dir2/script.sh).
The scripts should be run every quarter of an hour, but the problem is only /data/dir1/script.sh is executed.
Some of my gray cells claim that there needs to be a
blank line at the end of a crontab file ... not sure why
they do so, I didn't seen anything to that effect in
the man pages ...
Thing is, if I have a blank line at the end of
bleh.cron, and do crontab bleh.cron, the
actual crontab DOESN'T inherit the blank
line. In crontab -e I have to manually add
a line afterwards.
I just don't get it: in both lines I use absolute paths, both are correct (e.g.: I can do "less [path]" and it will work) and still only the first one is executed..
I removed the dir1 entry and waited.. Seems like there is _something_ wrong, but I don't know what.
I'll shortly explain what the script does in order for you guys to understand me better:
the script reads a file in the same directory (status.txt) and greps 'n' cuts a few things out of it, puts those tings into variables.
Then I let the script run lynx -dump [URL] , where [URL] is a link to de central status server. The URL contains the variables in the querystring (e.g.: "input.php?a=BlackRabbit&ID=1").
The ID is used like a primary key on the webserver: the corresponding statusinfo is updated on the webserver.
As said, both scripts sit in their own directory, each having their own status.txt for themselves.
When executing the scripts manually, the status is properly updated (1 => 1, 2 => 2) on the central status webserver, with crontab, it's always the first (with ID=1) that is updated..
When I echo the $url variable (in my script), everything is also fine...
Kind of weird
Last edited by BlackRabbit; 06-17-2004 at 07:06 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.