cPanel Backup Script

#!/bin/bash
ls /var/cpanel/users | grep ‘^a’ > a.txt
cat ./a.txt | while read CPUSER; do
echo “Now processing ${CPUSER} …”
/scripts/pkgacct ${CPUSER}
done

The below script should help to force backups for particular domains on server .  Line  “ls /var/cpanel/users | grep ‘^a’ > a.txt ” copies account names starting with alphabet a to a file a.txt, which is then called and processed .

If you want to run account name starting with say  a, b, c, d, e, f then the line “ls /var/cpanel/users | grep ‘^a’ > a.txt ” can be replaced as “ls /var/cpanel/users | grep -E ‘^a|^b|^c|^d|^e|^f'”

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: