Skipping domain in backup? its possible?

Its possible make backup of all sites form shell with backup command and skip specific single or multiple domains list?


Box with domains called
etc etc

I want make backup of all domains but need skip

Its possible?


I apreciate any information available.

You can’t tell it to back up all domains but skip a particular domain but you can provide a list of the domains you want it to back up

/home/interworx/bin/backup.pex --domains=domain1.comain2,domain4 --file-path="/home/backups"

Again, you need to specify ALL of the domains you want, but this list can be as long as you want.

well yes i can make script for this, but in the future make selective backup can be util feature specially when have big sites and want skip that super big sites of the backup

some idea how can obtain list of all domains hosted on server spareted by , in one line?

try something like this

find /home/ -type d -maxdepth 2 -name "*.*" | awk -F / '{print$4}'

It should give you the list of all domains. One domain per line. I’d personnaly write the result in a file with > /mydir/mydomainlist

After you just have to read the file by doing something like
for domain in cat /mydir/mydomainlist
One domain treatment

Hope it might helps you

if you want to check, just append | wc -l at the end of the command to have the total of found domains. Like this ypu’d might check if it is ok


Pascal, after i have the list, how can remove domains orf that list, some idea of the best way to make that?

Example of list:


And i want remove of that txt list domain3 and domain 4.

Some idea about the best way?

I should probably also mention the little known script in the InterWorx bin dir: listaccounts.pex. It dumps out the uniqname and domain name, per line, of every account on the box. For example:

$ ~iworx/bin/listaccounts.pex

You could then do something like this:
~iworx/bin/listaccounts.pex | awk ‘{print $2}’

which will produce:

If you wanted to filter out something (like remove the .com domains from the list), you can do:
~iworx/bin/listaccounts.pex | awk ‘{print $2}’ | grep --invert-match .com

which will produce:

Check the grep man page for more ways you can filter those results.


Exelent this is exactly waht i need !! :slight_smile:

Well this way its great, more easy an reliable way to obtain list full domains, but i try figure how can filter of list generated multiple domains.

example, i have hosted this domains:

etc etc

I just need filter, and, for obtain list without this 2 domains, some idea?

The idea its filter multiple domain list, form list of doamins to backup : )

Some idea how can make that?


Yep like you say, in the manual of grep fin teh way :slight_smile:

~iworx/bin/listaccounts.pex | awk ‘{print $2}’ > list
cat list | grep --invert-match --file=skiplist

where skiplist is the list to domains to skip, one per line : )

best regards

well i have now the list with skiped domains,…but the trouble its how send that list to script /home/interworx/bin/backup.pex --domains=

The backup accept domains separated like this:

/home/interworx/bin/backup.pex --domains=doamin1,domain2,domain3

My list is one per line…so some idea how fix this?
I need this for finish the new version of backup frontend i make for interworx.

As I told before

do something like

for domain in cat /mydir/mydomainlist
/home/interworx/bin/backup.pex --domains=$domain

It will backup one domain per domain, but it is exactly like (or very nearest) /home/interworx/bin/backup.pex --domains=doamin1,domain2,domain3

I’m not sure it changes something to launch n times backup.pex with one domain than lauching it one time with all domains. In all cases if it change something I promise you it is not time/cpu usage as I did some tests (way way a long a time ago…) and it was same.

So you just have to cat your list and for every entries in it you just have to call the backup.pex


for a in cat list2; do
/home/interworx/bin/backup.pex --domains=$a --file-path=/root

work perfect in this way, thankyou pascal

Cool and glade to know I’d help you :slight_smile:

Do not hesitate. We are few programmers at office, personnaly not really shell programmer but there is other guys at my office whom help you if need, so do not hesitate


Thank you : )