Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
11-09-2010, 07:53 AM
|
#1
|
|
Member
Registered: Aug 2009
Posts: 46
Rep:
|
cron - how to give priority to a task running in cron.daily?
Hello,
I have two custom tasks running daily. How do you give priority to one over the other?
One of them is configured via the logrotate.conf. The other sits directly in cron.daily.
The logrotate script checks for a certain file and:
ifempty
daily
create **** root utmp
rotate 1
prerotate
file > /var/log/fileToWriteTo
chmod *** /var/log/fileToWriteTo
endscript
I'd like the one in cron.daily to run after the script that is in logrotate.
Please can you advise how to do this...
Many thanks in advance!
|
|
|
|
11-09-2010, 08:02 AM
|
#2
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
well, logrotate is also in cron.daily for me. So, name your script such that it comes alphabetically after logrotate.
|
|
|
|
11-09-2010, 08:10 AM
|
#3
|
|
Member
Registered: Oct 2010
Location: New England, USA
Distribution: OpenSUSE/Slackware64/RHEL/Mythbuntu
Posts: 187
Rep:
|
logrotate is in cron.daily on my system, also. You could rename logrotate to "00-logrotate" and name your script to "01-my_script_name" and see if that works.
|
|
|
|
11-09-2010, 08:41 AM
|
#4
|
|
Member
Registered: Aug 2009
Posts: 46
Original Poster
Rep:
|
Ah. Ok - thank you.
I've had not seen your replies, so actually did it myself in a round about way (I think)
Basically created a new directory called scripts and then put the desired script in there.
Then, did a crontab -e
and appended to it:
0 7 * * * /pathToScript
When you do a crontab -l it comes up as above.
A bit more faff than what you've suggested,but will that work okay? (as in run daily at 7am?)
Many Thanks
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:16 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|