LINUX.ORG.RU

Запуск приложений из cron'a


0

0

Здравствуйте,

Возникла у меня задача включить bit-torrent клиент transmission по расписанию. Погуглил, нашел крон, разобрался как конфиг редактировать. Проблема заключается в том, что когда я оставляю команду в кроне на открытие какого-либо приложения (например - '10 22 * * * gedit'), приложение открывается и сразу же закрывается (скорее всего так, так как другие команды, например ping, touch я проверял, и они действительно работают).

Вопрос на миллион: что нужно написать в кроне, чтобы приложение открылось и оставалось открытым?

*Пробывал gedit, setsid gedit, gedit &


А transmission не умеет начинать качать по расписанию?

asdfghzxcvbn
()
Ответ на: комментарий от gasya

man cron:

"Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. The -n option changes this default behavior causing it to run in the foreground. This can be useful when starting it out of init."

andreyu ★★★★★
()

Вопрос, а зачем вообще гуйню, которая требует пользовательских действий запускать по крону?

andreyu ★★★★★
()
Ответ на: комментарий от gasya

> Ладно, тогда как заставить трансмишн качать не через GUI?

Этого не знаю, т.к. не пользуюсь подобным софтом. Но думаю, что почитав мануал, все прояснится.

andreyu ★★★★★
()
Ответ на: комментарий от gasya

% transmissioncli                                                                                                               [00:11:52, Tue, April 21]
Transmission 1.51 (7970) - http://www.transmissionbt.com/
A fast and easy BitTorrent client

Usage: transmission-cli [options] <torrent-filename>

Options:
  -h  --help                            Display this help page and exit
  -a  --announce             <url>      Set the new torrent's announce URL
  -b  --blocklist                       Enable peer blocklists
  -B  --no-blocklist                    Disable peer blocklists
  -c  --comment              <comment>  Set the new torrent's comment
  -d  --downlimit            <speed>    Set max download speed in KB/s
  -D  --no-downlimit                    Don't limit the download speed
  -er --encryption-required             Encrypt all peer connections
  -ep --encryption-preferred            Prefer encrypted peer connections
  -et --encryption-tolerated            Prefer unencrypted peer connections
  -f  --finish               <script>   Run a script when the torrent finishes
  -g  --config-dir           <path>     Where to find configuration files
  -i  --info                            Show torrent details and exit
  -m  --portmap                         Enable portmapping via NAT-PMP or UPnP
  -M  --no-portmap                      Disable portmapping
  -n  --new                  <source>   Create a new torrent
  -p  --port                 <port>     Port for incoming peers (Default: 51413)
  -r  --private                         Set the new torrent's 'private' flag
  -s  --scrape                          Scrape the torrent and exit
  -t  --tos                  <tos>      Peer socket TOS (0 to 255, default=0)
  -u  --uplimit              <speed>    Set max upload speed in KB/s
  -U  --no-uplimit                      Don't limit the upload speed
  -v  --verify                          Verify the specified torrent
  -w  --download-dir         <path>     Where to save downloaded data

У тебя думаю есть и русский хелп :]

kapsh
()

DISPLAY=:0 в строке запуска укажи просто.

vden ★★
()
Ответ на: комментарий от gasya

>Ладно, тогда как заставить трансмишн качать не через GUI?
У transmission давно web интерфейс есть. 
init скрипты + скрипты Block List Updater, Watch Directory Script, Bandwidth Scheduler, Fetch new torrents from tvrss, Stop finished torrents, Queue torrents so that only a certain number is active at any given time, Stop finished torrents and move data to a new location, Network traffic graph, based on rrdtool 

http://trac.transmissionbt.com/wiki/Scripts

init скрипты для gentoo со ссылками на багзиллу
http://sudormrf.wordpress.com/2009/03/07/transmission-151/

init_6 ★★★★★
()
Ответ на: комментарий от kapsh

kapsh  в правильную сторону смотришь товарищ. Но демон+веб морда всяко удобнее чистой консоли. Демона можно как тут по расписанию заставить кочать/раздавать http://trac.transmissionbt.com/wiki/Scripts/Scheduler 

Это не говоря о том что еще немного допилив можно такого демона сделать который при появлении firefox, opera, wget и т.п. будет вообще останавливать использование сети торрентами ;) 

init_6 ★★★★★
()
Ответ на: комментарий от init_6

спасибо всем большое за советы. постараюсь в следущий раз внимательнее мануалы читать =)

gasya
() автор топика
Ответ на: комментарий от andreyu

>man cron:
>"Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. The -n option changes this default behavior causing it to run in the foreground. This can be useful when starting it out of init."


ты хоть сам понял, что тут написано? хватит советовать то, в чем сам не разбираешься!

val-amart ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.