Find the answer to your Linux question:
Results 1 to 5 of 5
Hey I am trying to setup cron to start transmission at a certain time - simply becuase my internet usage limits are in peak and off-peak times - I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176

    [SOLVED] Cron issues... i think


    Hey
    I am trying to setup cron to start transmission at a certain time - simply becuase my internet usage limits are in peak and off-peak times - I have entered the details into crontab but it doesn't start.

    I tried it with rtorrent as well and it doesn't start.
    However when i set it up to move a file from one place to another at a certain time i have no issues.

    I there something else that needs to be done to have an app open.

    what i entered into crontab is something like...

    30 22 * * * /usr/bin/rtorrent

    the dir might be off becuase i'm at work, but you get the idea.

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,132
    It is probably failing because there isn't any X server connection. This is similar to starting a ssh connection...you need to specify one. In fact you may have to amend the $PATH anyway as generally the $PATH for cron is quite limited. Try writing a wrapper script something like this (just for example)
    Code:
    #!/bin/bash
    export DISPLAY=:0.0
    /usr/bin/transmission
    exit 0

  3. #3
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176
    I haven't had to use a scirpt before, so i just wanna make sure i do this right.

    Would I do this by making a text file say 'crontrans' which would contain

    #!/bin/bash
    export DISPLAY=:0.0
    /usr/bin/transmission
    exit 0

    and in crontab I would have the line

    30 22 * * * /home/geeth/crontrans

    Is that correct?

    I did find something as well while digging through the net for a crontab entry which is similar to what you have stated.

    30 22 * * * export DISPLAY=:0.0 /usr/bin/transmission

    so the script but just as a one line entry in crontab.

    Also I am a little confused about 'amend the $PATH' I will have a look around while I wait for a reply.

  4. #4
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176
    Heres what I have done - mainly for people that come across this one day - and it worked. this is pretending it's close to 1030 pm and that the file is on my Desktop

    Made a empty file called 'crontab'

    In the file I put in

    Code:
    #!/bin/bash
    export DISPLAY=:0.0
    /usr/bin/transmission
    exit 0
    Saved file and

    Code:
    chmod +x crontab
    ran
    Code:
    crontab -e
    added line

    30 22 * * * ~/Desktop/crontest

    saved

    And transmission ran fine and started to download.


    Thanks Bigtomrodney.

    Ps solved but don't know if i can mark as solved or mod has to

  5. #5
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,487
    Hi Geeth, you can mark the thread solved. It is in the thread tools menu at the top of the thread.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •