FreeGuide

FAQ »

# Download Listings From Cron

- View

- Home Page
- Download And Install
- User Guide
- Help And FAQ
- Developers
- Credits
- Screenshots
- Links
- Site Map
- Contact Us

# I run Linux: how can I setup a cron job to have FreeGuide retrieve listings?

You'll need to use XMLTV to download the listings, and then put them somewhere so FreeGuide can import them the next time it starts up.

Essentially, you'll use the XMLTV grabber to retrieve the listings and redirect to an .xmltv file in the FreeGuide directory. The next time you start FreeGuide, the new listings will be read in.

- First, figure out exactly what the xmltv grabber command is. Under Options, Advanced, you can highlight the XMLTV grabber and see the command that's used. For me, the command is:

`tv_grab_na_dd --quiet --config-file "%config_file%"`
The config file is stored in the FreeGuide working directory under a sub-directory called xmltv-configs. You will need to specify the exact path, the variable in the command above won't work right.

- Just to keep the crontab cleaner looking, create a shell script with the command in it:

    #!/bin/bash
    tv_grab_na_dd --quiet --config-file ~/.freeguide/xmltv-configs/na_dd.conf  > ~/.freeguide/list.xmltv

If your .freeguide working directory is *not* in your home directory, then you'll need to replace the ~/ part with the path to the FreeGuide directory.
chmod the file 700 and try running it. The script should download the latest listings and dump them out to an .xmltv file in your .freeguide directory.
Go ahead and start FreeGuide. There should be a short delay as it reads in the downloaded listings.

- Assuming the command worked right, then you can create a cron entry for calling the script.

If you're unfamiliar with cron, I suggest reviewing the crontab man page via "man 5 crontab".
There are 5 fields that define *when* a cronjob is run. To do a cronjob that runs at 5:30 on Sunday, then run 'crontab -e' and put on a single line:
`30 5 * * 0 ~/bin/SHELLSCRIPT`
Use whatever you called your shell script instead of SHELLSCRIPT.
If your cronjob is run as the user, it should work at the correct time. If you end up with an error about command not found or something, you will probably need to specify the exact path to the shell script like this:
`30 5 * * 0 /home/YOUR_USERNAME/bin/SHELLSCRIPT`

Good luck, and Contact Us if you have problems.

If you would like to help improve this site, please Contact Us and we will give you the password to edit pages.
Page last modified on June 04, 2008, at 02:33 AM PmWiki Info | - - - () -