mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
dns backup function
This commit is contained in:
parent
d708923022
commit
eaf4f14776
1 changed files with 30 additions and 4 deletions
|
@ -52,7 +52,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
|
|||
mkdir $tmpdir/web/
|
||||
|
||||
# Parsing unsuspeneded domains
|
||||
conf="$V_USERS/$user/web_domains.conf"
|
||||
conf="$V_USERS/$user/web.conf"
|
||||
field='$DOMAIN'
|
||||
search_string='DOMAIN='
|
||||
domains=$(dom_clear_search)
|
||||
|
@ -76,10 +76,10 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
|
|||
tar -cf $tmpdir/web/$domain/$domain.tar \
|
||||
public_html public_shtml private document_errors cgi-bin stats
|
||||
|
||||
# Creating web_domains config
|
||||
# Creating web.config
|
||||
cd $tmpdir/web/$domain/
|
||||
conf="$V_USERS/$user/web_domains.conf"
|
||||
grep "DOMAIN='$domain'" $conf > conf/web_domains.conf
|
||||
conf="$V_USERS/$user/web.conf"
|
||||
grep "DOMAIN='$domain'" $conf > conf/web.conf
|
||||
|
||||
# Apache config
|
||||
if [ "$WEB_SYSTEM" = 'apache' ]; then
|
||||
|
@ -143,6 +143,32 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then
|
|||
fi
|
||||
mkdir $tmpdir/dns/
|
||||
|
||||
# Parsing unsuspeneded domains
|
||||
conf="$V_USERS/$user/dns.conf"
|
||||
field='$DOMAIN'
|
||||
search_string='DOMAIN='
|
||||
domains=$(dom_clear_search)
|
||||
|
||||
for domain in $domains; do
|
||||
if [ -z "$output" ]; then
|
||||
echo -e "\t$(date +%H:%m:%S) $domain"
|
||||
fi
|
||||
|
||||
# Building directory tree
|
||||
mkdir $tmpdir/dns/$domain
|
||||
|
||||
# Creating dns_domains config
|
||||
cd $tmpdir/dns/$domain/
|
||||
conf="$V_USERS/$user/dns.conf"
|
||||
grep "DOMAIN='$domain'" $conf > dns.conf
|
||||
|
||||
# Backingup dns recods
|
||||
cp $V_USERS/$user/zones/$domain $domain
|
||||
cp /etc/namedb/$domain.db $domain.db
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Mail domains
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue