LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-22-2006, 04:23 PM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
scheduled task


Hey guys, how's it going?

I have this scheduled task that runs under a certain userid, username's id is 509. Cool. I figured that if i want to stop that task from running on a regular schedule, i should just type crontab -r under that username and the thing would go away. I've been proven wrong. The task keeps running. So, HOW CAN I STOP IT!?

FYI, when i execute crontab -e under that specific username, i get an 'write error to swap' error. Of course, this tells me nothing. On the other hand, when doing this for root, i don't get this error. And also, if you guys now how to get rid of all the history that ps aux displays, that's great, so i can monitor a little bit better if the process is still running.

There's my problem. Please please help me out. I got another problem to solve and perhaps getting this task out of there will stop named from crashing.

Thanks in advanced for the help.

Last edited by trebek; 09-24-2006 at 03:39 AM.
 
Old 09-22-2006, 05:22 PM   #2
Aeiri
Member
 
Registered: Feb 2004
Posts: 307

Rep: Reputation: 30
Quote:
Originally Posted by trebek
if you guys now how to get rid of all the history that ps aux displays, that's be great, so i can monitor a little bit better if the process is still running.
If I understand that correctly...
Code:
ps aux | grep "PROCESS_NAME"
As for the bigger problem, what you are saying sounds like you are wanting to not only stop the scheduled task from running in the future, but shut down the currently running instance of the task as well, am I correct?

If so, then "crontab -r" will remove the scheduling, but if the process is running, you'll need to execute a "killall PROCESS_NAME" to kill the current instance.
 
Old 09-22-2006, 08:04 PM   #3
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
you could aswell use
service crond stop
to stop all cron jobs.
 
Old 09-22-2006, 09:06 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by trebek
The task keeps running. So, HOW CAN I STOP IT!?
As someone else said, removing the cron schedule does not kill any running task that was previously scheduled. Use 'kill', or 'pkill', or 'killall' to get rid of the running task.

Quote:
FYI, when i execute crontab -e under that specific username, i get an 'write error to swap' error. Of course, this tells me nothing.
It tells me you're probably out of disk space.

Quote:
On the other hand, when doing this for root, i don't get this error.
Probably because when you create a filesystem, you can reserve a little extra space that is available to root only. So normal users are out of space, but root is using that extra 5% reserve that is typically set aside. Run "df -h" and see if any of your filesystems are full.

Quote:
And also, if you guys now how to get rid of all the history that ps aux displays, that's be great, so i can monitor a little bit better if the process is still running.
Do you mean get rid of all the other processes that are listed ? (it's not a "history", just other processes)

As was said earlier, you can run "ps -ef | grep <process_name>"
(or "ps aux | grep <process_name>" if you prefer that format)

Alternately, "ps -fp `pgrep <process_name>`" will do the same thing, but leave the column headings displayed (the grep method would have wiped them out).
 
Old 09-24-2006, 03:37 AM   #5
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
YOU GUYS ARE GENIOUSES!!! This information has helped me a whole lot. Now, i managed to stop that thing from running, at least that's what i can tell so far. Not sure though. The thing that is hanging up on me now is the disk space thing. This is probably the cause of linux stalling sometimes, and of course, having named stop resolving. And now that you have brought up the subject, how do we clean up some disk space in linux? Of course, silly question, in a sense. But then, i always check log files, like /var/log/messages, and the you've got new mail in /var/spool or something when performing something with root. The real question would be: how can i clear unnecessary info from linux, info that is not put there by me or other users?

I hope you understand what i am asking, and if not, i'll post another thread asking how to do this.
I've been struggling with this server for quite a while now, and i can't go on researching, i got to fix it ASAP.

BTW, i cannot thank you guys enough, keep being smart, you rock!!!

Last edited by trebek; 09-24-2006 at 03:49 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Task bar no longer shows task Richard Rahl Linux - Newbie 3 04-12-2010 09:39 AM
Scheduled shutdown scherfistv Linux - General 2 07-12-2006 12:43 AM
Scheduled task in linux? Dakkar Linux - Newbie 4 12-30-2003 08:54 AM
Scheduled tasks... beserier Linux - General 1 01-24-2003 08:55 AM
scheduled maintenance adenardo Linux - General 1 12-23-2002 01:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration