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.

Create text file when add / remove domain.

Discussion in 'General Discussion' started by joaosavioli, Feb 7, 2008.

  1. joaosavioli

    joaosavioli Member

    Joined:
    Feb 7, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi everyone,

    I need create a text file when a domain is created and removed.
    domaintest.com created
    domaintest2.com removed
    domaintest3.com removed
    domaintest123.com created

    I edited the file /scripts/wwwacct, but not worked.
    system("echo $domain created >> /root/log.txt");

    File /scripts/killacct:
    system("echo $domain removed >> /root/log.txt");


    My cpanel verion is 11.
    I had this in old cpanel version, but cpanel 11, I can´t.

    Please, help-me.

    Joao
     
  2. joaosavioli

    joaosavioli Member

    Joined:
    Feb 7, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Please, help-me.
    It is very important.

    Thank you
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Instead of modifying /scripts/wwwacct, in cPanel 11 you should modify /scripts/postwwwacct for accounts created (/scripts/postkillacct for accounts terminated). Documentation on this is available at:

    http://www.cpanel.net/support/docs/hooks.htm
     
  4. joaosavioli

    joaosavioli Member

    Joined:
    Feb 7, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi David!

    Thank you

    But, I can´t locate this file.
    Look:
    [root@linux]# cat /scripts/postkillacct
    cat: /scripts/postkillacct: No such file or directory

    [root@linux]# cat /scripts/postkillacct
    cat: /scripts/postkillacct: No such file or directory

    Where are these files?

    Thank you!
    Joao
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    YOu have to create those files and make them executable:

    Code:
    touch cat /scripts/postkillacct
    chmod +x cat /scripts/postkillacct
    
     
Loading...

Share This Page