Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to start the ubuntu update at night because internet is free at that time. and then kill the process in order to ensure that it does not download anything after 7:00 AM.

Is there any way to know the process ID of the cron job in order to kill it before the process run? Or any other way?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

if you are just doing an apt-get update, apt-get upgrade, you can do this

sudo crontab -e
1 0 * * * apt-get update;apt-get -y upgrade
6 58 * * * pkill -9 apt-get
share|improve this answer
    
Your second cronjob is incorrect, it should be 58 6 * * *. The first field is minutes, and the second is hours. –  Alaa Jun 26 '13 at 18:28
    
How can it be done as the task is running? (Killing a running cron process manually?) –  Kin Jun 26 '13 at 19:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.