Skip to main content

Copy one file into all accounts?

Comments

3 comments

  • nixuser
    You can use bash to do this. Add all the users to a file named users. cat /etc/userdomains | awk {'print $2'} | sort | uniq > users Then do a one-liner to copy the file to accounts. for user in `cat users`; do /bin/cp path-to-ads.txt /home/$user/public_html/; done
    0
  • cPanelLauren
    While the above would be for existing accounts, for new accounts you can add the ads.txt file into the skeleton directory so it'll be automatically added when creating new accounts. The documentation here should be useful: Skeleton Directory - Version 82 Documentation - cPanel Documentation
    0
  • Sujoy Dhar
    I
    You can use bash to do this. Add all the users to a file named users. cat /etc/userdomains | awk {'print $2'} | sort | uniq > users Then do a one-liner to copy the file to accounts. for user in `cat users`; do /bin/cp path-to-ads.txt /home/$user/public_html/; done

    it worked :)
    0

Please sign in to leave a comment.