Cool One Liners #2; The one line cpanel packaging

OK, so we are migrating to a new server and we have a lot of accounts to migrate. Here’s a quick and dirty one liner to make it happen:

grep -v “*: nobody” /etc/userdomains |cut -d: -f2 | sort | uniq | xargs /scripts/pkgacct {} \;

This will remove the generic (nobody) user from the list, separate the user from their respective domain, and execute the pkgacct command.

1 Response

  1. Tyler Bishop July 20, 2013 / 12:28 pm

    Counting on cPanel user checking you can do:
    cd /home/; for i in *; do /scripts/pkgaccnt $i; done;

    This has changed now with cpanel’s safe restore mode… thanks to me and Michael Denny!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.