Program output in terminal by invoking in cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Program output in terminal by invoking in cron
# 8  
Old 01-27-2012
Tried on a unix system (not tried on Linux).
Login to a normal telnet session.
Find out the tty.
Code:
tty

Do not log out.
Write a simple wrapper script for your program and manually insert the tty:
This assumes that "vt100" is actually correct for your terminal.

Code:
TERM="vt100"
MYTTY="/dev/whatever"
/usr/bin/rtorrent my_torrent_files 2>&1 > ${MYTTY}

This will only work if the program does not issue any "tput" commands because they will not work in background.

Because the terminal must be logged in, you might as well just run a normal script which checks the time periodically.
# 9  
Old 01-29-2012
Hi, I wasn't able to make it by Your example, but I have found partial solution, namely I have typed into my crontab file:
Code:
0 0 * * * env DISPLAY=:0.0 xterm -e "/usr/bin/rtorrent /home/pioter/Torrent/files/DEU/*.torrent"
0 9 * * * /usr/bin/pkill rtorrent

it invokes xterm (instead tty). Although it needs Xs it runs rtorrent as I wanted it to. Still, if anyone would have any idea how to conduct it by means of raw /dev/ttys I would be more than thankful Smilie
# 10  
Old 01-29-2012
In the early days this was pretty easy because a serial terminal had a fixed address associated with the physical terminal socket on the computer (a "tty" address).
With TCP/IP comms comes dynamic allocation of pseudo-tty addresses (a "ptty" address).
# 11  
Old 01-30-2012
I think this is overhead.

90% of OP funcionality can be achived by modifying .rtorrent.rc and using screen.
So i reccomend reading about rtorrent options, it's probably the most configurable torrent client out there.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

2. Shell Programming and Scripting

Who -u gives different output if run from cron than if run from terminal?

If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this: testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy) running the same through cron I get: testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
Discussion started by: latimer
2 Replies

3. UNIX for Dummies Questions & Answers

invoking non-standard program in linux

I have a program R installed on Ubuntu under /usr/bin/R. I also have a different version installed under /home/user/R. I would like to invoke the locally installed program temporarily. How can I do this automatically by running a script and then switching to the default program? thanks, SM (2 Replies)
Discussion started by: smeme
2 Replies

4. Shell Programming and Scripting

Invoking a program in a loop

In the following script, I wish to invoke a compiled C++ program, consimv4 and pass it some command line arguments through the shell script's command line arguments and variables. But for some reason, when I run the script, I just return to the shell prompt and nothing happens. For the life of me,... (7 Replies)
Discussion started by: msaqib
7 Replies

5. Shell Programming and Scripting

issue invoking shell script using cron, even with proper file permission

I am using tcsh what could possibly be a problem, when using crontab to invoke a shell script. ? The script has the read, write and execute permission to all users. And the script works as expected while executing it in stand-alone mode. Is there a way to trace (like log) what error... (9 Replies)
Discussion started by: vikram3.r
9 Replies

6. Shell Programming and Scripting

cron or terminal ?

Hi all, I need a way to test from within a script if it is running from cron or from terminal. The ways I found till now are: 1) test if $PPID corresponds to the cron daemon 2) see if $TERM has a valid terminal value or "'dumb", in which case it is ran by cron ... but I feel the... (2 Replies)
Discussion started by: pbillast
2 Replies

7. Shell Programming and Scripting

Calling C program from cron results in no output

I can call a C program from the shell and results are outputted as normal. The C program processes some files and spits out a .csv file. If I scheduled it in cron, there is no output. If their a special way to schedule C programs in cron? thanks & regards (1 Reply)
Discussion started by: hazno
1 Replies

8. Shell Programming and Scripting

Problems installing a program in Terminal

Hey First of all: I'm on a Mac. I'm quite new to this, so forgive me if i sound like a newb :-) I wish to install the Deluge BitTorrent client. First of all I installed Macports and made it run smooth. But then I ran into a problem when I should install Deluge. I can post the log, and maybe... (4 Replies)
Discussion started by: Sixmax
4 Replies

9. Programming

terminal device control through a C/C++ program

Hi, I want to fork a new process from a daemon that needs terminal attachment to some ttyN or pts/N device. Here is the code #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <string.h> int main(int... (5 Replies)
Discussion started by: ku@ntum
5 Replies

10. Programming

invoking an Unix script from a C Program

How to invoke an Unix Script from C program? (or) How to invoke another C program from a C program? thanks Karthik (5 Replies)
Discussion started by: fermisoft
5 Replies
Login or Register to Ask a Question