Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Automatic creation of extra public_html folders.

Discussion in 'General Discussion' started by Paulgeee, Feb 22, 2019.

  1. Paulgeee

    Paulgeee Registered

    Joined:
    Feb 22, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    gloucestershire
    cPanel Access Level:
    Root Administrator
    Hello EV1, I am new here and have been using cpanel since it first started many moons ago.


    I would ideally like a default folder to be created when a new account is created with cpanel in /home/*/public_html/mynewfolder and/or a file in /home/*/public_html/mynewfile.html and be persistently created even if the user deletes it.

    I have noticed that cgi-bin is persistent on my machine even if deleted also the .well-known folder has appeared.

    This is mainly for instructions how to set up their site so it can be shared, I also would like to automatically create an index.php file either copied or automatically created if one does not exist as a default document.

    I can do this on a straight Linux machine @ command line however cpanel is so embedded and I would prefer to do it the correct way and in such a way that does not break a live machine :)

    Has anyone done this here before and if so would welcome some help.

    Thanks
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Paulgeee,

    The Skeleton Directory feature supports what you need for new accounts:

    Skeleton Directory - Version 78 Documentation - cPanel Documentation

    For existing accounts, or for cases where a user deletes the directory/files, you'd have to develop a custom script to re-create the files and then setup that custom script to run automatically as part of a cron job.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Paulgeee

    Paulgeee Registered

    Joined:
    Feb 22, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    gloucestershire
    cPanel Access Level:
    Root Administrator
    Hi
    And Thank you I gathered as much after reading your FAQ just hoped there was something I missed, I looked at the SKEL directory but also prefer an application that systematically does the entire job.

    I am thinking of rolling this out to several of my servers and forgetting a step in the process is not an option.

    so now have now created an application using cron that does all this for me monitoring user account directories that does not interfere with cpanel itself, although at a later date I may turn it into a plugin.

    Thanks for the confirmation.

    Paul

     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Paul,

    I'm glad to see you were able to develop a custom script to do what you need. If you decide to create a plugin and have any questions, feel free to reach out and let us know.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice