The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Run a /scripts script through cron

Discussion in 'General Discussion' started by czerdrill, Jan 12, 2015.

  1. czerdrill

    czerdrill Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    I want to run the /scripts/generate_maildirsize as a cronjob, but can't figure out what command to put in the tab. Can anyone help me figure this one out? Thanks!
     
  2. mageshm

    mageshm Well-Known Member

    Joined:
    Apr 17, 2014
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Chennai, INDIA
    cPanel Access Level:
    DataCenter Provider
    @ czerdrill,

    Ary you trying to run .php or other extension file. If so, mention the location. for example if you are going to run the .php file in cron you should mention the php path then file name like below.

    0 13 * * * /usr/local/bin/php /home/xxxx/public_html/cron/newsletter/index.php
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    What method are you using to create the cron job? You could use "crontab -e" to add it directly as a root cron job via the command line.

    Thank you.
     
  4. czerdrill

    czerdrill Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Hi Michael, I may have not been clear. It's one of the cpanel predefined scripts namely the generate_maildirsize.

    I tried adding /scripts/generate_maildirsize to the crontab and when it runs it says no such file or directory.

    I'm trying to make whatever that script does (which is regenerate the maildirsize file) run as a cron job but I don't know what command to enter into the crontab. Any ideas?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Are you adding this as a root cron job? If so, please post the exact cron job entry that you used. Also, what error do you see in /var/log/cron when it runs?

    Thank you.
     
Loading...

Share This Page