Results 1 to 6 of 6

Thread: Webmin Cron Jobs

  1. #1
    Registered+
    Join Date
    Oct 2009
    Location
    Bristol
    Posts
    50
    Thanks
    0
    Thanked
    0 times in 0 posts
    • burn-e86's system
      • Motherboard:
      • Gigabyte P55-UD2
      • CPU:
      • core i5 750
      • Memory:
      • 4Gb ddr1600C9
      • Storage:
      • 500Gb
      • Graphics card(s):
      • ATI 4650 512mb X2
      • Case:
      • silverstone TJ08
      • Operating System:
      • Win 7 64bit
      • Internet:
      • god I hate 02...

    Webmin Cron Jobs

    I'm trying to get my server to run the Playstation Media Server on boot. Unfortunately my skills with Linux really are not that good. Currently to run it i use Putty and run:
    /home/user/pms/java -jar pms.jar
    which runs the server in the terminal. Does anyone know how I would go around sceduling a Cron job for this?
    When I copy the command into the cron job it says that it cannot find /java.
    Failing running it using cron. can someone help me run it at boot?

  2. #2
    Senior Member burble's Avatar
    Join Date
    May 2007
    Location
    Olney
    Posts
    1,138
    Thanks
    8
    Thanked
    90 times in 89 posts

    Re: Webmin Cron Jobs

    Cron isn't the way to do this. Cron is meant for scheduled jobs on an hourly, daily (and so on) basis. What'll happen here is that every time the cron job runs the media server will start but you only want a single instance of it running. Now that shouldn't be a problem because once the first instance is running any subsequent instances should exit as the first instance will already be bound on the port.

    When you SSH in using PuTTY, do you literally type /home/user/pms/java -jar pms.jar to run the media server or do you just do java -jar pms.jar? The key difference there is with the first one you're saying that the java executable is in /home/user/pms which I expect isn't the case. You should be able to create a startup action that runs 'java -jar /home/user/pms/pms.jar' which would run the java executable that is in $PATH and then load the JAR file specified. Failing that when you're SSH'd in type 'which java' and you'll get a path back, something like /usr/bin/java (the exact path can vary depending on what Linux distro you're running) so in that case the command you need is '/usr/bin/java -jar /home/user/pms/pms.jar'

    It has been ages since I used webmin but from what I remember creating a startup action is pretty self explainatory once you know the command you want to run.

  3. #3
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: Webmin Cron Jobs

    Actually, you can use cron to start programmes when the system cron daemon starts by using @reboot instead of the time specification. There are a number of @ pesudo-time specifiers.

    anyway, log into the machine and type crontab -e and enter as follows:
    Code:
    @reboot ${HOME}/pms/java -jar ${HOME}/pms/pms.jar
    I assume your default text editor is nano so just Ctrl+O, then Enter to save, and Ctrl+x to quit.
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  4. #4
    Registered+
    Join Date
    Oct 2009
    Location
    Bristol
    Posts
    50
    Thanks
    0
    Thanked
    0 times in 0 posts
    • burn-e86's system
      • Motherboard:
      • Gigabyte P55-UD2
      • CPU:
      • core i5 750
      • Memory:
      • 4Gb ddr1600C9
      • Storage:
      • 500Gb
      • Graphics card(s):
      • ATI 4650 512mb X2
      • Case:
      • silverstone TJ08
      • Operating System:
      • Win 7 64bit
      • Internet:
      • god I hate 02...

    Re: Webmin Cron Jobs

    Thanks for all your help, I got it running using a cron job with the command
    @reboot /usr/bin/java -jar ${HOME}/PMS/pms.jar

    The only problem i've got now is when I play anything that requires transcoding (using Mcoder), PMS quits after a few seconds. Anyone got any ideas on that?

  5. #5
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: Webmin Cron Jobs

    It's probably a PMS bug. Why don't you just use mediatomb? Search for it with your package manager.
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  6. #6
    Registered+
    Join Date
    Oct 2009
    Location
    Bristol
    Posts
    50
    Thanks
    0
    Thanked
    0 times in 0 posts
    • burn-e86's system
      • Motherboard:
      • Gigabyte P55-UD2
      • CPU:
      • core i5 750
      • Memory:
      • 4Gb ddr1600C9
      • Storage:
      • 500Gb
      • Graphics card(s):
      • ATI 4650 512mb X2
      • Case:
      • silverstone TJ08
      • Operating System:
      • Win 7 64bit
      • Internet:
      • god I hate 02...

    Re: Webmin Cron Jobs

    Found that I was not deploying it correctly and decided to follow this guide:
    http://www.infobarrel.com/HOWTO:_PS3...0_karmic_koala
    it turns out it was a problem with mcoder rather than with psm. Now the only problem is that my crappy ass network doesnt like to stream HD even though its at 54Mb. I'm pretty sure it's because of 02's wireless Box II. Changed the cron job to use the start-pms.sh created in the guide.

    I tried using mediatomb but it was a pain in the back side trying to get it to work with mkv's and it didn't my setup at the time.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 15
    Last Post: 19-04-2010, 09:21 PM
  2. Hosting that supports cron jobs...
    By 360bhp in forum PC Hardware and Components
    Replies: 3
    Last Post: 26-11-2008, 09:26 AM
  3. Replies: 3
    Last Post: 30-05-2008, 09:53 AM
  4. Cron Job Problems
    By Matt1eD in forum Software
    Replies: 4
    Last Post: 19-02-2006, 01:00 PM
  5. Setting up cron jobs in 10.3 server?
    By Stoo in forum Apple Mac
    Replies: 2
    Last Post: 26-08-2005, 06:35 PM

Posting Permissions

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