Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 11-03-2007, 09:53 PM   #1 (permalink)
In The Zone
 
unni's Avatar
 
Join Date: Mar 2006
Location: Thiruvananthapuram (Now in Bengaluru)
Posts: 386
Default How do I start a task through terminal using cron?


Hi friends,
I want to schedule apt-mirror so that it would start at 2 am. But the problem is that there is no feedback of what's going on after the job starts. I am sure that its running and is doing what it is supposed to do. If I start it from konsole, apt-mirror would say "this much data is to be downloaded, this much number of files to be downloaded" etc. How do I set cron such that it would launch the apt-mirror task through konsole?
unni is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 12-03-2007, 10:20 AM   #2 (permalink)
El mooooo
 
eddie's Avatar
 
Join Date: Jan 2006
Location: India
Posts: 1,414
Default Re: How do I start a task through terminal using cron?

You can execute your command in konsole by prefixing it with "konsole -e". For example if I want to run a mpg321 instance in a new konsole window then I would give the following command
Code:
konsole -e mpg321 /home/edward/xyz.mp3 &
When executed from a command window, this will create a new konsole window and start mpg321 in it, which will play xyz.mp3 file.

Before you put this code in your crontab file do remember to check that your xhost allows connections from root because that is what you'll be doing. You can also wait for mediator (or PM him) to come in and see your problem. He might have a solution using a bash script.
eddie is offline  
Old 12-03-2007, 11:18 AM   #3 (permalink)
In The Zone
 
unni's Avatar
 
Join Date: Mar 2006
Location: Thiruvananthapuram (Now in Bengaluru)
Posts: 386
Default Re: How do I start a task through terminal using cron?

Thanks eddie . I used the following command:
Code:
DISPLAY=unix:0 /usr/bin/konsole -e apt-mirror
This was what I wanted.
Quote:
Originally Posted by eddie
Before you put this code in your crontab file do remember to check that your xhost allows connections from root because that is what you'll be doing.
What did you mean by this? I didn't run the above as root, only as a normal user with sudo privilege. I am using Ubuntu.
unni is offline  
Old 13-03-2007, 01:03 AM   #4 (permalink)
El mooooo
 
eddie's Avatar
 
Join Date: Jan 2006
Location: India
Posts: 1,414
Default Re: How do I start a task through terminal using cron?

In some distros executing GUI applications with "super user" privileges is not allowed. That is what I was referring to.
eddie is offline  
Old 17-03-2007, 05:20 AM   #5 (permalink)
In The Zone
 
Vivek788's Avatar
 
Join Date: Jul 2006
Location: Cochin
Posts: 340
Default Re: How do I start a task through terminal using cron?

can u give me a brief info on using cron effectively?
Vivek788 is offline  
Old 18-03-2007, 07:41 PM   #6 (permalink)
El mooooo
 
eddie's Avatar
 
Join Date: Jan 2006
Location: India
Posts: 1,414
Default Re: How do I start a task through terminal using cron?

^ Here is one for you
http://gentoo-wiki.com/Cron
eddie is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 10:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2