adding a job to cron (to kill my X session, runlevel 3, and my login)
I have to leave this machine in about 20 minutes (max.) and my X-Session is open cause I am downloading some files that *should* finish in 15 minutes... How can I add a job to cron to make it kill my X-Session and my bash-login at tty2? Thanks, Raúl
Raúl Gutiérrez Segalés writes:
I have to leave this machine in about 20 minutes (max.) and my X-Session is open cause I am downloading some files that *should* finish in 15 minutes... How can I add a job to cron to make it kill my X-Session and my bash-login at tty2?
you could do this in a shell: $ sleep 900; killall X or: $ sleep 900; kill <the X pid> xdm ought to restart X after you kill it.
Thanks,
Raúl
Jesse Marlin writes:
Raúl Gutiérrez Segalés writes:
I have to leave this machine in about 20 minutes (max.) and my X-Session is open cause I am downloading some files that *should* finish in 15 minutes... How can I add a job to cron to make it kill my X-Session and my bash-login at tty2?
you could do this in a shell:
$ sleep 900; killall X
or:
$ sleep 900; kill <the X pid>
xdm ought to restart X after you kill it.
Forgot to mention that you must be root to kill X.
On Thursday 06 December 2001 21.36, Raúl Gutiérrez Segalés wrote:
I have to leave this machine in about 20 minutes (max.) and my X-Session is open cause I am downloading some files that *should* finish in 15 minutes... How can I add a job to cron to make it kill my X-Session and my bash-login at tty2?
Thanks,
Raúl
at 18.00 <press enter> kill -9 <pid of bash-login on tty2> <press ctrl-d> this will queue an at job to 6pm that will kill the login shell. This will also kill your startx. Be sure you don't have any jobs running with data that should be saved, because this will kill the programs without any questions asked. regards Anders
Raúl Gutiérrez Segalés wrote:
I have to leave this machine in about 20 minutes (max.) and my X-Session is open cause I am downloading some files that *should* finish in 15 minutes... How can I add a job to cron to make it kill my X-Session and my bash-login at tty2?
I don't know about using cron to kill the xserver, because you won't know when the download is done. It may stall for awhile. I think a better way to do it would be to download with "screen". Start an ftp session with screen, and put it in the background, then logout, it will timeout when the download completes. That way you don't need an open logon on an unattended terminal. Use wget or some other commandline url grabber if you need to do an http download. man screen ...it's very easy
participants (4)
-
Anders Johansson
-
Jesse Marlin
-
Raúl Gutiérrez Segalés
-
zentara