Skip to content

Instantly share code, notes, and snippets.

@classmember
Last active November 10, 2017 17:32
Show Gist options
  • Select an option

  • Save classmember/df40912fadf6d7972a2b724fc4f8fac4 to your computer and use it in GitHub Desktop.

Select an option

Save classmember/df40912fadf6d7972a2b724fc4f8fac4 to your computer and use it in GitHub Desktop.
#!/bin/sh
# list primary domains of all
# cPanel backups in the current directory.
for file in $(\ls backup-*); do
tar --occurrence=1 \
--to-stdout \
--extract \
--verbose \
--gzip \
--file=${file} \
*/userdata/main | \
awk '/main_domain/{print $2}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment