Results 1 to 10 of 36

Thread: 12.04 64-bit, "prettynames" cron job stopped running - need help

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    229
    Distro
    Ubuntu 12.04 Precise Pangolin

    12.04 64-bit, "prettynames" cron.hourly job stopped running - need help

    I set up a hourly cron job on my friends Mythbuntu 12.04 machine to call the mythrename.pl script (which creates simlinks with human-readable names in a folder called "pretty").

    I set this up right after a fresh load of 12.04 64-bit, and it was working fine.
    On August 21 it quit running.
    Can anyone help me diagnose why it stopped?

    Here's how the setup looks:

    I created a folder called pretty:
    /var/lib/mythtv/pretty
    Since the mythtv user will access it, I gave ownership to the mythtv user.
    I also gave wide premissions to the folder to be sure all users could access it:
    Code:
    drwxrwxrwx 2 mythtv mythtv 32768 Aug 21 01:17 pretty
    I put a script in /etc/cron.hourly called "prettynames" which calls the mythrename.pl script once an hour:
    Code:
    #!/bin/bash
    /usr/bin/mythrename.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    I made sure the mythrename.pl script was executable:
    Code:
    chmod 755 usr/bin/mythrename.pl
    Code:
    -rwxr-xr-x 1 root root 18590 Aug 28 21:16 mythrename.pl
    As I mentioned this was all working, and the /var/lib/mythtv/pretty directory was populated every hour with nice, readable filenames, UNTIL Aug. 21. Now, all the symlinks in the folder are dated Aug. 21. Here's an example:
    Code:
    lrwxrwxrwx 1 root root 50 Aug 21 01:17 The Twilight Zone - Time Enough at Last - 2012-07-15, 10-55 PM.mpg -> /var/lib/mythtv/recordings/1053_20120715225500.mpg
    I tried invoking the prettynames script from a command line and it ran ok and updated all the symlinks in the pretty folder.
    Code:
    user@Mythbuntu:/$ /etc/cron.hourly/prettynames
    Are there any ideas or troubleshooting methods to help me figure out why it stopped automatically populating the "pretty" folder?

    I note that when the cron job ran, the symlinks in the pretty folder were owned by root.

    When I called the prettynames script as my friend's username, all the symlinks in the pretty folder were owned by his username.

    In the prettynames script, should I be calling the mythrename.pl script with another user, such as the mythtv user?
    If so, how do I do that?

    Help appreciated.
    Eric
    Last edited by neutron68; September 1st, 2012 at 06:15 PM. Reason: added info

  2. #2
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    229
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    As an update of things I've tried...

    I read that mythrename.pl has been deprecated by mythlink.pl.
    http://www.mythtv.org/wiki/Mythrename.pl
    http://www.mythtv.org/wiki/Mythlink.pl

    I edited the prettynames script to call mythlink.pl rather than mythrename.pl.
    Code:
    #!/bin/bash
    /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    It didn't help. The script still won't run as an hourly cron job.

    As before, the script will run if you manually call it from a command line, so we know it can run, IF it gets called.
    Code:
     user@Mythbuntu:/$ /etc/cron.hourly/prettynames
    I'd appreciate any insight into the malfunction of cron.

    Thanks.

  3. #3
    Join Date
    Jul 2008
    Location
    North Central Indiana
    Beans
    248

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Well, you could do some basic diagnostics like adding a 'touch <file>' to your script (to ensure the cron job IS actually running). Then, if it is, you could see whether the perl script can generate stderr or log output and gather that (by passing options in the script).

  4. #4
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    229
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by anonymousdog View Post
    Well, you could do some basic diagnostics like adding a 'touch <file>' to your script (to ensure the cron job IS actually running). Then, if it is, you could see whether the perl script can generate stderr or log output and gather that (by passing options in the script).
    I like that idea and was thinking of something similar, but was not sure how to do it.

    I just read this page:
    http://www.linfo.org/touch.html

    Do you mean that I should add the touch command into the prettynames script?
    Any recommendations where the new, empty file should be created?

    Thanks,
    Eric
    Last edited by neutron68; August 31st, 2012 at 04:11 AM. Reason: added info

  5. #5
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    I like that idea and was thinking of something similar, but was not sure how to do it.

    I just read this page:
    http://www.linfo.org/touch.html

    Do you mean that I should add the touch command into the prettynames script?
    Any recommendations where the new, empty file should be created?

    Thanks,
    Eric
    It will go where you tell the program to put it. I suggest a full path (eg /root/testfile-`date`

    But the first thing to do in any troubleshooting is look at the log files!

  6. #6
    Join Date
    Sep 2008
    Location
    Melbourne, Australia
    Beans
    42
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    I had a similar problem.

    Does your script delete all the links in the pretty folder before creating new ones? I can't remember the exact cause, but there were some links (somehow) created that the script couldn't delete so it just stopped. It was still running; it just wasn't doing anything.

    Probably isn't your problem if you can manually run the script and get a result, but worth checking.

  7. #7
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    As an update of things I've tried...

    I read that mythrename.pl has been deprecated by mythlink.pl.
    http://www.mythtv.org/wiki/Mythrename.pl
    http://www.mythtv.org/wiki/Mythlink.pl

    I edited the prettynames script to call mythlink.pl rather than mythrename.pl.
    Code:
    #!/bin/bash
    /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    It didn't help. The script still won't run as an hourly cron job.

    As before, the script will run if you manually call it from a command line, so we know it can run, IF it gets called.
    Code:
     user@Mythbuntu:/$ /etc/cron.hourly/prettynames
    I'd appreciate any insight into the malfunction of cron.

    Thanks.
    Try looking at your log files

Tags for this Thread

Bookmarks

Posting Permissions

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