backup for vesta files and db skeleton

This commit is contained in:
Serghey Rodin 2011-08-14 17:34:46 +03:00
parent 19e12d9890
commit aa5971eb3d

View file

@ -53,8 +53,8 @@ if [ -z "$output" ]; then
fi fi
# Addding vesta version # Addding vesta version
echo "1.0" >$tmpdir/version echo "1.0" >$tmpdir/backup_version
echo "$VERSION" > $tmpdir/vesta echo "$VERSION" > $tmpdir/vesta_version
# WEB domains # WEB domains
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
@ -178,6 +178,10 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then
cp $V_USERS/$user/zones/$domain $domain cp $V_USERS/$user/zones/$domain $domain
cp /etc/namedb/$domain.db $domain.db cp /etc/namedb/$domain.db $domain.db
done done
if [ -z "$output" ]; then
echo
fi
fi fi
@ -185,7 +189,29 @@ fi
# TBD # TBD
# DatbaBases # DatbaBases
# TDB if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
if [ -z "$output" ]; then
echo "-- DB --"
fi
mkdir $tmpdir/db/
# Parsing unsuspeneded domains
conf="$V_USERS/$user/db.conf"
field='$DB'
search_string='DB='
dbs=$(dom_clear_search)
for db in $dbs; do
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) $db"
fi
done
if [ -z "$output" ]; then
echo
fi
fi
# Cron jobs # Cron jobs
if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then
@ -195,7 +221,14 @@ if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then
mkdir $tmpdir/cron/ mkdir $tmpdir/cron/
# Backingup cron recods # Backingup cron recods
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) cron.conf"
fi
cp $V_USERS/$user/cron.conf $tmpdir/cron/ cp $V_USERS/$user/cron.conf $tmpdir/cron/
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) system cron"
fi
cp /var/spool/cron/$user $tmpdir/cron/ cp /var/spool/cron/$user $tmpdir/cron/
if [ -z "$output" ]; then if [ -z "$output" ]; then
@ -209,9 +242,15 @@ if [ ! -z "$WEB_SSL" ] && [ "$WEB_SSL" != 'no' ]; then
if [ -z "$output" ]; then if [ -z "$output" ]; then
echo "-- CERTIFICATES --" echo "-- CERTIFICATES --"
fi fi
mkdir $tmpdir/cert
# Backingup ssl certificates # Backingup ssl certificates
cp -r $V_USERS/$user/cert $tmpdir/ for cert in $(ls $V_USERS/$user/cert/); do
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) $cert"
fi
cp $V_USERS/$user/cert/$cert $tmpdir/cert/
done
if [ -z "$output" ]; then if [ -z "$output" ]; then
echo echo
@ -220,8 +259,44 @@ if [ ! -z "$WEB_SSL" ] && [ "$WEB_SSL" != 'no' ]; then
fi fi
# Vesta # Vesta
if [ -z "$output" ]; then
echo "-- VESTA --"
fi
mkdir $tmpdir/vesta
# Backingup vesta configs
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) user.conf"
fi
cp -r $V_USERS/$user/user.conf $tmpdir/vesta/
if [ -e "$V_USERS/$user/billing.log" ]; then
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) billing.log"
fi
cp -r $V_USERS/$user/billing.log $tmpdir/vesta/
fi
if [ -e "$V_USERS/$user/reseller.conf" ]; then
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) reseller.conf"
fi
cp -r $V_USERS/$user/reseller.conf $tmpdir/vesta/
fi
if [ -e "$V_USERS/$user/history.log" ]; then
if [ -z "$output" ]; then
echo -e "\t$(date +%H:%m:%S) history.log"
fi
cp -r $V_USERS/$user/history.log $tmpdir/vesta/
fi
if [ -z "$output" ]; then
echo
fi
exit
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta # # Vesta #