Commit 4890df2c authored by Igor Pečovnik's avatar Igor Pečovnik
Browse files

update

parent 807ef87c
#!/bin/bash
DATE=`date +%F`
DBBACKUPNAME="mysql-"$DATE
WEBBACKUPNAME="website-"$DATE
FILEBACKUPNAME="website-"$DATE
# change this
COPY_TO=/root/temp/$DATE
COPY_FROM=/var/www/clients
USER=
PASSWORD=
HOST=localhost
#
mkdir -p $COPY_TO
echo "";
echo "************************************";
echo " CRONTAB BACKUP";
echo "************************************";
echo "";
crontab -l > $COPY_TO/crontab-root.txt
echo "";
echo "************************************";
echo " DATABASES BACKUP";
echo "************************************";
echo "";
for db in $(echo 'SHOW DATABASES;'|mysql -u$USER -p$PASSWORD -h$HOST|grep -v '^Database$'|grep -v "^performance_schema" |grep -v "^information_schema" |grep -v "^mysql");
do
mysqldump \
-u$USER -p$PASSWORD -h$HOST \
-Q -c -C --add-drop-table --add-locks --quick --lock-tables \
$db | gzip --best -c > $COPY_TO/$DBBACKUPNAME-$db.sql.gz;
echo "Backup of" $db;
done;
echo "";
echo "************************************";
echo " WEB BACKUP";
echo "************************************";
echo "";
echo "Wait a moment please...";
for x in $(find $COPY_FROM -maxdepth 2 -name "web*" -type d -print0 | xargs -0)
do
tar -cpvzf $COPY_TO/$WEBBACKUPNAME-$(basename $x).tar.gz $x &> /dev/null
done;
echo "";
echo "************************************";
echo " CONF BACKUP";
echo "************************************";
echo "";
service dovecot stop
service cups stop
service transmission-daemon stop
service hostapd stop
service postfix stop
service tvheadend stop
service samba stop
/etc/init.d/scanbuttond stop
# backup only minimum
tar cvPfz $COPY_TO/$FILEBACKUPNAME-allfiles.tgz -T filelist.txt --exclude='*.sock'
#
service dovecot start
service cups start
service transmission-daemon start
service hostapd start
service postfix start
service tvheadend start
service samba start
/etc/init.d/scanbuttond start
echo "";
echo "************************************";
echo " INSTALLED PACKAGE LIST BACKUP";
echo "************************************";
echo "";
aptitude search '~i !~M !~pstandard !~pimportant !~prequired' | awk '{print $2}' > $COPY_TO/installedpackages
/etc/dovecot/dovecot.conf
/etc/cups/
/etc/transmission-daemon/
/etc/scanbuttond/
/etc/dovecot/dovecot.pem
/etc/dovecot/private/dovecot.pem
/etc/cups
/etc/fstab
/etc/transmission-daemon/settings.json
/etc/scanbuttond
/etc/apache2
/etc/dbconfig-common
/etc/init.d/scanbuttond
/etc/init.d/hostapd
/etc/postfix/
/etc/mysql/
/etc/postfix
/etc/rc.local
/usr/local/bin/.sync
/etc/mysql/my.cnf
/etc/default/stunnel4
/usr/bin/tv_grab_file
/home/hts/.hts/tvheadend/
/etc/samba/
/home/hts/.hts/tvheadend
/etc/samba/smb.conf
/etc/modules
/etc/network/interfaces
/etc/hostapd.conf
/etc/init.d/hostapd
/etc/usbsrvd.conf
/etc/default/stunnel4
/etc/stunnel
service stop dovecot
service stop cups
service transmission-daemon stop
service hostapd stop
service postfix stop
service tvheadend stop
service samba stop
service samba stop
/etc/init.d/scanbuttond stop
/etc/init.d/rc.usbsrvd stop
/etc/stunnel/gmail.conf
/usr/local/ispconfig/interface/ssl/startssl.chain.class1.server.crt
/usr/local/ispconfig/interface/ssl/startssl.sub.class1.server.ca.crt
/root/removecomptorrent.sh
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment